treehouse : what would you like to learn today?
Web Design Web Development iOS Development

.htaccess Urgent help needed please

  • I need to move one wordpress site to another domain.

    Both domains will be pointed to the same nameserver, ie. they are both working on the same folder and have the same root.

    I need a .htaccess file that moves http://olddomain.com/testcategory/ to http://newdomain.com/testcategory/ for example.

    So the only thing that is different is the domain. If somebody clicked a page from an old link on another site to the old link they will be redirected to the new domain but the URL will still be intact.

    Does this make any sence?

    Any help would be much appreciated.
  • Read this http://www.javascriptkit.com/howto/htaccess7.shtml
  • Jeff Starr has a pretty comprehensive .htaccess guide:

    http://perishablepress.com/press/2006/0 ... ss-tricks/

    There is definitely information in there on that.
  • Thanks apostrophe and chris.

    I ended up using

    redirect / http://www.domain.com/


    after pointing the original domain to a new fonder wit the .htaccess mentioned above.

    ----------

    On a similar note, you could do a screencast about this back end server stuff, like useful tips or something, providing you know what I mean.
  • I found a more comprehensive code.



    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^domain2.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domain1.com$
    RewriteRule ^(.*)$ \"http\:\/\/www\.domain2\.com\/$1\" [R=301,L]