« New Site Launched!!
» LinkedIn Profile for Arvell Craig

Better Search Engine Ranking, Internet Marketing Help

The 301 Redirect: Search Engine Preferred Redirecting

01.20.08 | 1 Comment

If you are going to upgrade, redesign, or change hosting of your website, you need to use a 301 redirect. Why?

Every single page of your website has a history on the internet. And there could be websites linking to your website using one of the many subpages of your website. Such as: www.yourdomain.com/help/frequently-asked-question.htm.

If you have your website redesigned with all new names like changing from the extension .html to .htm or .php, you need to make sure people do not end up at a “Page Cannot Be Found” error page- thus you may lose that visitor.

301 Redirects are preferred by search engines to ‘meta refesh’ code - which is inserted in the actual old page.

There are two was to do it.

The first is within each page by inserting the following code:

ColdFusion Redirect


<.cfheader statuscode=”301″ statustext=”Moved permanently”>

<.cfheader name=”Location” value=”http://www.new-url.com”>

PHP Redirect

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

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>

The second way is by editing the .htaccess file or simply…

1. Creating a new file called htaccess.txt

2. Adding the code for every page that will be redirected:
redirect 301 /oldpage.html http://www.new-url.com/newpage.php

3. Uploading the file to the root directory of the server.

4. Change the file name to “.htaccess” (remove the “.txt” and add a “.” at the beginning.

Powered by ScribeFire.

1 Comment

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« New Site Launched!!
» LinkedIn Profile for Arvell Craig