Blog Homepage : Category - Advanced SEO
Email This Article301 redirects are used to tell browsers including search engine spiders that pages have been moved, and to notify them of the new location.
However there is much confusion on what the best type of redirect is, as well as confusion on the proper way to implement it.
In this article we cover the bases looking at the most common types of redirects as well as how to implement them.
There are various forms of 301 redirects. Some occur on the server (known as a server side redirect) and some happen on the page. If you need to implement a 301 redirect, it helps to know the differences between each, so you can determine what the best one to use is.
There are also different types of these redirects depending on the technology you use.
Using mod_rewrite and .htaccess.
Add the following code to redirect your entire site to another domain name:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ http://www newdomain.com/$1 [R=301,L]
using .htaccess without mod_rewrite
If the host doesn’t support mod_rewrite, you could try this with your .htaccess file and apache:
Redirect 301 / http://www newdomain.com/
Using php to perform a 301 redirect
You can also redirect on a page by page basis using php:
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www newdomain.com/newdir/newpage.htm");
exit();
Using asp to perform a 301 redirect
The above options are generally used in php and apache. If you don’t run apache or use php, you can still do redirects. Here is how you can redirect on a page by page basis using asp:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www. newdomain.com/newdir/newpage.asp"
response.end
%>
Performing a 301 redirect in ASP.NET
Similarly, if you use asp.net, you can do the following:
Performing a 301 redirect on IIS 5/6
If your site is hosted on Windows IIS you can take the following actions to redirect your domain:
1. Go into your website properties via Internet Services Manager.
2. Under the ‘Home Directory’ tab, select ‘A redirection to a URL’ rather than ‘A directory located on this computer’.
3. Type the destination in the ‘Redirect to:’ field and make sure you check the ‘A permanent redirection for this resource’ box (this is what makes it a 301 redirect).
Using the above method you can redirect an entire website as above, or a specific folder or even file via ‘right-click’ -> ‘properties’.
To Redirect a page:
1. Choose the site you want to forward.
2. Choose the webpage you want to forward in it, then right click on the it and choose “Properties”..
3. The default is the first choice, “The designated file”. Change it to “A redirection to a URL” and type in the new URL
Using ISAPI Rewrite to Redirect a domain
There are many third party applications which can also be used to perform server side redirects. ISAPI Rewrite is just on of them.
In your httpd.ini file, add the following code:
RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]
Using ISAPI Rewrite to Redirect a page
In your httpd.ini file, add the following code:
RewriteRule /old-page.asp http://www.example.com/new-page.asp [I,O,RP,L]
Implementing a 301 redirect in ColdFusion
If you don’t use Apache or ASP, you can still do redirects. Here is a Coldfusion example:
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www. newdomain.com">.
How to Redirect HTML
Finally, if you aren’t able to access the server, and only have an HTML page, there is an option. Insert the following meta tag:
You must note however that this isn’t the best solution. Only Yahoo! currently treats this as a 301, other engines treat all meta refresh tags as 302).
Rob Sullivan is a SEO Consultant and Writer for Textlinkbrokers.com
ARCHIVES

![XML RSS FEED [XML RSS FEED]](http://www.textlinkbrokers.com/blogs/images/xml.gif)


