Divi WordPress Theme

Topic: 301 Redirect using PHP - Permanent Redirect HTTP 301  (Read 4097 times)

Offline Kevin

  • Junior Guru
  • **
  • Posts: 72
  • iTrader: +4/-0
    • View Profile
301 Redirect using PHP - Permanent Redirect HTTP 301
« on: August 10, 2008, 04:00:43 PM »
You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:

Code: [Select]
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>
Kevin
VPS Hosting - AccuWebHosting

Offline muckle.martin

  • Newbie
  • *
  • Posts: 5
  • iTrader: +0/-0
    • View Profile
Re: 301 Redirect using PHP - Permanent Redirect HTTP 301
« Reply #1 on: December 14, 2008, 01:10:47 PM »
Thanks for sharing. Is HTTP/1.1 necessary? I think a Location header would be good enough. Because this might also work with HTTP/1.0 clients.

Quote from: "Kevin"
You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:

Code: [Select]
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>
Kevin
Divi WordPress Theme
Tags: