Permanent (301) Redirects - Managing the Google Index
Have you heard of 301 (permanent) redirects? If you haven’t let me explain what they are to you.
A 301 redirect is a tool available at your disposal as a webmaster that allows you to manage your indexed pages within the major search engines including Google.
Let me give you an example:
1- You have decided to change your url structure by removing the file extensions such as “.php”, “.html” etc… and you want to delete the old pages so that you do not have a duplicate content issue. If you don’t perform a 301 redirect from the old URLs to the new ones then you’ll be faced with these issues:
-
Your old pages indexed by Google will point to pages that no longer exists
-
Sites who have linked to you in the past will now be linking to pages that do not exist
-
All the link popularity you’ve acquired over the years will no longer there.
So what do you do to avoid all that? … You 301 the old URLs to the new ones using the following methods depending on the server technology you’re using:
IIS Redirect
-
In internet services manager, right click on the file or folder you wish to redirect
-
Select the radio titled “a redirection to a URL”.
-
Enter the redirection page
-
Check “The exact url entered above” and the “A permanent redirection for this resource”
-
Click on ‘Apply’
ColdFusion Redirect
<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”>
PHP Redirect
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>
ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com/”);
%>
ASP .NET Redirect
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com”);
}
</script>
JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>
CGI PERL Redirect
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);
Ruby on Rails Redirect
def old_action
headers[”Status”] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end
Redirect Old domain to New domain (htaccess redirect)
Create a .htaccess file and insert in it the code below. The .htaccess file needs to be placed in the root directory of your site.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newurl .com/$1 [R=301,L]
REPLACE http://www.newurl.com/ in the above code with theactual url you want to redirect .
Note* This redirection method only works on Linux-based servers with the Apache Mod-Rewrite module enabled.
Benefit of 301 Redirects
By performing a 301 redirect you are in effect telling Google et al to disregard your old urls and to replace them with the new ones. In time Google will remove all the old URLs from it index and replace them (along with their link popularity) with the new ones … et voila!
N.B You can also perform a 302 (temporary) redirect in the same methods mentioned above however 302 redirects are rarely used and I personally think they just server to confuse the search engines.
Good luck with your redirection and if you have any questions please feel free to ask here.


























