Redirecting a web page to another using a 301 redirect
If you read our blog entry yesterday, we talked about using dashes over underscores when you name a web page. So what do you do if you already named your pages incorrectly and you want to fix them? You 301 redirect them. You want to do this for many reasons. First of all, doing this will automatically send all traffic to your new page. Second and most important, this tells search engines that the web page has moved. Doing this will transfer all of your PageRank to the new page and eventually the search engines will remove the old pages from their index. It does take some time so you have to be patient.
Now there are many ways to do a 301 redirect. It depends on what type of server you’re on and what type of files you’re dealing with.
PHP Redirect
This is how it is done with PHP pages. You would basically take the content off your old, underscore pages and then put it on your new dashed pages. Once you do that, add this code to the old page and you are good to go:
<?php
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: /new-web-page.php”);
?>
ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”/new-web-page.php”
%>
.htaccess
A .htaccess file is a special file that you can use on a Linux server. You can add this code to the .htaccess file. If your site is just html pages, this is the best way to go.
Redirect 301 /old_web_page.html http://www.yourdomain.com/new-web-page.html
There are many other ways to do this with other languages, but these are the most common. If you believe that your web pages are incorrect and you want to fix them, contact us and we can work with you to get them fixed.
Tags: seo
