How to 301 Redirect Entire Domain

Did you get a new domain and now want to point all the URLs from the old domain to the new one?
If you’re using Apache Web Server, you can do this with a .htaccess file. 301 redirects are Google SEO friendly as well and should preserve link juice over time.

Put the following in a .htaccess file in the folder that your old domain is pointed to:

RewriteEngine On
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

Of course, you do need to replace www.newdomain.com with the REAL domain name.

About the Author

A Calgary based web developer specializing in e-Commerce sale of industrial and technical products from manufacturers such as Fluke, BW Technologies, Flir and Extech.