Divi WordPress Theme

301 Redirect using PHP - Permanent Redirect HTTP 301

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

Offline Kevin

  • Junior Guru
  • **
  • Posts: 69
  • 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
Shopify Divi WordPress Theme
Tags:

[Stromonic] Web Hosting - 50% OFF w/ LiteSpeed, LSCache, MariaDB, HTTP/2 & CDN!

Started by hivalidityBoard Web Hosting Offers

Replies: 0
Views: 166
Last post September 07, 2021, 09:52:22 AM
by hivalidity
Vulnerability in HTTP.sys Could Allow Remote Code Execution (3042553)

Started by KailashBoard Vulnerabilities

Replies: 0
Views: 2577
Last post April 21, 2015, 05:36:57 PM
by Kailash
Black friday server blowout: quad servers at $30 (permanent price not an intro!)

Started by Webcs-PeterBoard Web Hosting Offers

Replies: 0
Views: 1445
Last post November 26, 2015, 02:11:26 PM
by Webcs-Peter
Does free domain work permanent ?

Started by Ackerson26Board Domain Registration

Replies: 2
Views: 2955
Last post August 23, 2012, 04:30:33 PM
by annahussy
Plusplushosting.net: LiteSpeed + HTTP/2 in our premium shared hosting + 50% OFF!

Started by clockeditorBoard Web Hosting Offers

Replies: 0
Views: 1022
Last post September 09, 2016, 01:11:19 PM
by clockeditor