Thursday, November 10, 2005

PHP Header 301 Redirect - Moved Permanently

From time to time, pages change location. At times like these, one can use PHP header function with 301 to notify website visitors that the page has moved, assuming the $location contains the new URL.

Here is how you can use PHP header 301 redirect

header ('HTTP/1.1 301 Moved Permanently');
header ('Location: '.$location);


More information about header function can be obtained at PHP.net

  post to Del.icio.us

eXTReMe Tracker