301 redirect the best way

by Jeremy Schoemaker on September 12, 2005 · 2 comments

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.

About the author...

– who has written 2415 posts on ShoeMoney.com.

Hi I am Jeremy Schoemaker and ShoeMoney.com is my blog. 99% of the post here are done by me but you will see others occasionally make guest posts. This blog is fun to write but for my day job I run several online companies.

Images provided by ShutterStock


Mark recommends you read these posts also:

  1. Twitter___Jeremy_Schoemaker__The_Bluelight_Specials_are_...-20090725-175527 How Do I Make Money with Twitter? – Past, Present & Future
  2. shutterstock_47651305 PPV Advertising 101 – Untap the Potential (Part 1 of 3)
  3. shutterstock_69229366 Don’t Obsess About Design For Design’s Sake

{ 2 comments… read them below or add one }

1 Ken Savage May 6, 2007 at 1:09 pm

nice tutorial Jeremy

Reply

2 Harish October 9, 2008 at 4:44 am

good post man.Informative

Reply

Leave a Comment

Previous post:

Next post: