Support - Knowledge base

Giving you the answers you need

Why not try our knowledge base for instant help and advice to enhance your online experience with Register365? From within the knowledge base you can browse our frequently asked questions and find the right answers to help solve your queries.

Home  >  NEW  >  Hosting  >  Windows Hosting  >  View Article

Configuring a 301 Redirect

5*5*5*5*5*

Article

Redirecting with a 301 redirect

For many reasons, including search engine optimisation, it is important to add 301 redirects for any old pages on your site which no longer exist. There are many ways that you can do this, dependent on the hosting platform that your site operates from, as well as your own preference on what you are comfortable using. There are a few examples below which will allow you to create 301 redirects no matter which platform you are working from.

Example for Apache and .htaccess

RedirectMatch 301 (.*)\.htm$ http://www.example.com$1.php

Example for Zeus and rewrite.script

insensitive match URL into $ with ^/(.*)\.htm(l)?            
if matched then            
set OUT:Location = http://www.example.com/$1.php            
set RESPONSE=301            
set BODY=$1            
goto END            
endif

Example for PHP Redirect

<?     
Header( "HTTP/1.1 301 Moved Permanently" );     
Header( "Location: http://www.new-url.com" );     
?>

Example for ASP Redirect

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

Example for 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.example.com");       
}       
</script>

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed