This article will guide you through the procedure of redirecting a web page properly, the search engine friendly way with HTTP 301 status in order to tell search engines that the page has permanently moved to a different location.

A while back, a client approached me in order to help her change the name of her business website. This consisted of changing the name on the logo, banners and other parts of the site. Additionally, she purchased a new domain name with several different TLDs. I immediately made the suggestion that we should redirect all the other domains to the .COM domain so that multiple domains could “run” on the same application.

Why not META refresh?

I started off the redirect with the META refresh method and realized that it wouldn’t be search engine friendly because of the fact that a page with a META refresh already has an HTTP 200 status and search engines wouldn’t be notified that the page has moved permanently. So META refresh is not the best proposition! But in case you wondered what it looked like, I made an example below. This code would go into the HEAD section of the page.

<meta http-equiv="refresh" content="0;" />

The code above will refresh to the specified URL immediately. You could change the “0” to the number of seconds the page should wait before instructing the browser to redirect to the specified URL.

Doing it the search engine friendly way!

The proper way to redirect a web page is to use an HTTP 301 status header, telling the search engine bots/spiders that the page has moved permanently to a new location specified. You can do URL redirection in several different languages and methods. Below are several web page redirection examples.

Coldfusion Redirect

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="">

PHP Redirect


header("HTTP/1.1 301 Moved Permanently"); 


ASP Redirect

<%@ Language=VBScript %>

Response.Status="301 Moved Permanently"
Response.AddHeader "Location", ""


ASP.NET Redirect

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

Java Redirect


response.setHeader("Location", "");
response.setHeader("Connection", "close");


PERL Redirect

$r = new CGI;
print $r -> redirect("");

Ruby On Rails Redirect

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