Top 10 ways to create a 301 redirect

Tonight I redirected a new domain my brother-in-law purchased back to his main site. He and his wife are chiropractors in Ottawa (just setup, may 401 till it’s propogated!) and the new domain is a little shorter and easier to type in than their full domain name (

So I thought I would take the time to talk about an important SEO tool…

The 301 Redirect

Generally speaking if you’re moving domains therefore changing post permalinks) or changing blog categories etc, you’re going to want to use a 301 redirect.

A 301 redirect tells the search engines that the page in question has PERMANENTLY moved. In most cases it’s the best and most Search Engine friendly method for redirecting web pages as it’ll go a long way towards preserving your hard earned search engine juice.

So, without further adieu:

The Top 10 Methods to Create a 301 Redirect

(Do I have to mention that you need to REPLACE in the examples below with the actual domain name you want to redirect TO?)

1. JSP

response.setHeader( “Location”, “” );
response.setHeader( “Connection”, “close” );

2. PHP

Header( “HTTP/1.1 301 Moved Permanently” );
Header( “location:” );

3. IIS

From internet services manager, right click on the file or folder you wish to redirect; Select the “redirection to a URL” radio button and enter the new url. Place a checkmark for “The exact url entered above” and “A permanent redirection for this resource”

4. ASP

<%@ Language=VBScript %>
Response.Status=”301 Moved Permanently”;

5. Ruby on Rails

def old_action
headers["Status"] = “301 Moved Permanently”
redirect_to “”

6. .NET

<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
Response.Status = “301 Moved Permanently”;


$q = new CGI;
print $q->redirect(“”);

8. ColdFusion<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=””>

9. .htaccess *

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)$1 [R=301,L]

* Ensure Apache Mod-Rewrite moduled is enabled on your account

10. HTML *


<a href=``>Click Here to Go to My Other Site</a>


* I don`t recommend the HTML method as it’s not REALLY a 301 redirect!

(photo above from