SEO Speedwagon

Implementing a 301 (Permanent) Redirect - Part Two

Back in September 2005 I wrote a post discussing how to 301 redirect in .htaccess. In that post I did not mention two important points:

1. Always re-upload your modified .htaccess file in ASCII mode. FTP programs generally transfer files in Binary mode. The modified .htaccess file will not work if it's transferred in Binary.

2. When you edit the .htaccess file in notepad or other text editors they tend to add .txt file extensions on the end. You have to go ahead and upload the file with the extension and then rename it once it's on the server (remove the .txt).


Quoting myself from 2005 (2005?)

There could be many reasons why you may need to use a 301 server-side redirect. Usually having to do with a site redesign, pages that no longer exist, branding issues, marketing campaigns and/or a new domain name.

Server-side redirects are the safe way (as opposed to the meta refresh technique) to transfer your traffic to the new site while still retaining your search engine rankings.

The Moved Permanently directive in the HTTP header tells the spider that the page they crawled has permanently relocated to a new URL.

It will take usually 6-8 weeks to see the old site drop from the rankings and the new site indexed. In the meantime you will probably see fluctuations in your rankings and/or traffic until things settle down to a comfortable level.

How To Implement a 301 Re-direct

Permanent Redirects using .htaccess:

Download the .htaccess file from your server's root directory. If there is no .htaccess file present then go ahead and make one in notepad and save as .htaccess (just as it appears, no extension). Upload it to your root directory after you've made the changes (in ASCII mode).

Place the following code in the .htaccess file:

redirect 301 /index.html http://www.thenewsite.com/index.html - to redirect a single page
or
redirect 301 / http://www.thenewsite.com/index.html - to redirect a whole site


The initial command must be the path to the file name of the old page (/index.html)
That’s followed by a space
The final command must be the full URL of the new page (http://www.thenewsite.com/index.html)
If there is already code in the .htaccess file, place the new code at the bottom.
Upload the file to the server's root directory (in ASCII mode).


Here are a few other ways to redirect using your .htaccess file. These methods require the Apache Mod_Rewrite URL Rewriting Engine to be in place:


-Are you planning to move from an old domain to a new domain? There are many different reasons why you would need to do this. Place this code into your .htaccess file (modify to your URL):

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.thenewsite.com/$1 [R=301,L]


-Do you want to redirect from a non-www version of your URL to the www version so you can avoid the possibility of duplicate content? Try this code in your .htaccess file (modify to your URL)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^thenewsite.com [nc]
rewriterule ^(.*)$ http://www.thenewsite.com/$1 [r=301,nc]

Permanently redirect using IIS:

Start/Programs/Administrative Tools/Internet Services Manager

Click on the -Home Directory- tab.
Click the -A Redirection to a URL-.
Enter a URL in the -Redirected To:- section
Check the -A permanent redirection for this resource- to make it a 301. Leave it unchecked and it becomes a 302.
Click –Apply-

Copyright 2005-2007 Intrapromote, LLC