301 permanent redirect in php

When we migrated from a basic php driven website to this new blog style website for Coyol.net we needed to make sure we kept rankings for our pages. We did this by creating a permanent redirect for each page. The original website was really only 8 pages so it really wasn’t difficult to do at all.

Why is this important? Because by doing this we still get the traffic from our original pages AND the Search Engine spiders understand that those are old pages and they will filter them from the Search Results eventually. You’ll basically transfer your rankings from old page -> new page.


Here is the simple PHP redirect code that we used… Remove all content from original page/old page and replace it with this:

  1. <?
  2. header( "HTTP/1.1 301 Moved Permanently" ); //the original page was http://www.coyol.net/seo.php
  3. header( "Location: http://www.coyol.net/search-engine-optimization-seo" );
  4. exit();
  5. ?>

Watch how it works: http://www.coyol.net/seo.php

Posted under SEO/SEM, Web Design

This post was written by Coyol on September 12, 2008

Tags: , , ,

Leave a Comment

Name (required)

Email (required)

Website

Comments

More Blog Post