Zubrag.com
September 19, 2019, 03:39:16 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Permanent redirects in php  (Read 5671 times)
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« on: September 17, 2007, 10:47:11 AM »

What to do if page moved to another address, and you cannot setup redirect via admin control panel, or control panel is not smart enough to perform permanent redirects? (some control panels create 302 Moved Temporaly, which is not good for search engines)
Create a php page containing following code.

<?php

// set correct redirect header (301)
header("HTTP/1.1 301 Moved Permanently");

// perform redirect
header("Location: http://www.example.com/new-page.php?parameter1=value1&parameter2=value2");

exit();

?>

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC