I need to change the domain for both a wordpress and a number of hand-coded pages.
Is there a way to write something in .htaccess so that www.olddomain.com/* goes to the corresponding www.newdomain.com/* for everything?
I need to change the domain for both a wordpress and a number of hand-coded pages.
Is there a way to write something in .htaccess so that www.olddomain.com/* goes to the corresponding www.newdomain.com/* for everything?
Assuming you want everything redirected permanently:
RewriteEngine On
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
You'll want to use a proper 301 redirect so that search engines will know to start indexing the new domain... something like this should worK if applied before the rest of the rules:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} ^olddomain.com [nc]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [r=301,nc]