build-website-header
spacer-image
 

Web Page Redirects

There are several options available for redirecting a visitor from one web page/site to another, and it is important that you understand how to accomplish this is a safe and efficient manner.

The main problem with renaming/moving web pages is that the search engines may not find the new page and/or the page can get dropped from the search engines.

Therefore if a particular page is being ranked well in the search engines and getting lots of traffic it is best to leave it alone.

However if you must rename/move a webs page then there are several options but if possible I would advise that you use the .htaccess method and only consider the others when that option is unavailable or you don't feel confident that you can do it.

301 and 302 redirects

You will come across two redirects the Moved temporary(302) and the Moved permanently (301). You should always use the 301 moved permanently.

You can see a complete list of server status codes here.

Redirect  Options

  1. meta tags
  2. javascript - Note not recommended
  3. php coding
  4. asp coding
  5. .htaccess

Meta refresh tag

This is the easiest to implement and is done by the web browser and hence it is universally supported. It has been misused and so is not recommended except when no other option is available.

If used try to use in conjunction with the nofollow tag

<meta http-equiv="refresh" content="10" url="http://www.newdomain.com/newpage.htm"</meta>

<meta name="robots" content="noindex, nofollow"></meta>

 

Javascript

Not to be used as the search engines don't like it at all.

PHP Coding

This is safe from an seo viewpoint but obviously relies on your host supporting php.

<?
header("HTTP/1.1 301 Moved Permanently");
header("Status: 301 Moved Permanently");
header("Location: http://www.domain.com/newpage.htm");
exit(0);
?>

ASP Coding

This is safe from an seo viewpoint but obviously relies on your host supporting asp (windows hosting).

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.domain.com/newpage.asp"
%>

 

 .htaccess file

There are two ways of doing this.

The easiest is to use the redirect directive. For example to redirect request from an old folder to a new use the directive.

Redirect /old http://www.example.com/new

There are two main types of redirect a permanent (301) and temporary (302). A permanent redirect tells the visitor client to use the new url in the future and is used for moving old content to a permanent new location.

The temporary redirect is the default condition as is used when the condition is not permanent and may be changed in the future. The redirect directive can be modified to include the redirect type e.g.

Redirect permanent /oldpage.htm http://www.example.com/newpage.htm  or

Redirect301 /oldpage.htm http://www.example.com/newpage.htm  or

Redirect temp /oldpage.htm http://www.example.com/newpage.htm  or

Redirect 302 /oldpage.htm http://www.example.com/newpage.htm 

 

The other method is to use the mod-rewrite which although more complex is much more flexible and depending on how your sever is setup (your host does that) you may only be able to use this method as the other doesn't always work.

Here is a simple page redirect.

RewriteEngine on
RewriteBase /
Rewriterule ^oldpage.htm  /newpage.htm [R=301]

 

You can find more information on the rewrite in the apache rewrite guide

Resources:


 

spacer2-image