Written by: Sean Hakes

Sean Hakes

Several friends have asked what the most effective way is available to tell search engines that a web page or web site has moved permanently.

A PHP 301 Redirect is a simple way to tell major search engines that you have moved a page or entire website to a new location. To do that just copy and paste the code below into your php page, make sure to remove all of your HTML text as the php code below will be sufficient. Make sure you replace the URL with the location of your new website or pages.

What does a 301 PHP Redirect look like?

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

Header: The 301 “Moved Permanently” code returns a value that allows major search engines know that the web page has moved permanently from its current location.

The second required header line simply indicates where the new page or website has moved to. You can check your 301 PHP Redirect here.