301 Redirect

by admin on 2009/07/24

301 Redirect

php-301-redirectA 301 redirect also known as a “permanent redirect” is the most search engine friendly way of redirecting a webpage or domain name.

The easiest way to redirect a a domain in my opinion is to do it straight from the domain registrar. When you login to your account go to manage domains and select the particular domain you want to redirect, under that domains settings you will be given the option to 301 or 302 redirect a domain, you want to go for the 301 redirect. By choosing the 301 redirect you are telling the search engines that you want all the weight assigned to that domain to be passed to another domain.

If you are trying to redirect a webpage to another webpage within your site then you can use several methods depending on your preferred style of code. My choice is php so I would use a php 301 redirect like the example below:

PHP Redirect

<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.domain.com/page.php” );
?>

A couple of other popular choices are jave and asp.net:

 

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://www.new-url.com/”
%>

 

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.new-url.com”);
}
</script>

 

JSP (Java) Redirect

<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>

Leave a Comment

Previous post: Duplicate Content Issues

Next post: Uk Link Building Service