A lot of us webmasters from time to time will need to redirect traffic from one domain to another. We all know the best way to do this is with a 301 redirect but what is the best way to implement it?

(This assumes you are using the Apache webserver. If you are not… you should be.)

If you are the server admin and have direct access to the apache configuration file you can just put in:

redirect 301 / http://www.you.com/

in the VirtualHost Directive.

If you have a .htaccess file:

just put this as the last line after your other rules.

redirect 301 / http://www.you.com/

The first “/” indicates that everything from the top level of the site down should be redirected. As long as you are using the same paths and filenames, then this option is a very simple way to perform site redirection in the situation where you have only changed your domain name.

By Jeremy Schoemaker

Jeremy "ShoeMoney" Schoemaker is the founder & CEO of ShoeMoney Media Group, and to date has sold 6 companies and done over 10 million in affiliate revenue. In 2013 Jeremy released his #1 International Best selling Autobiography titled "Nothing's Changed But My Change" - The ShoeMoney Story. You can read more about Jeremy on his wikipedia page here.

2 thoughts on “301 redirect the best way”

Comments are closed.