PEAK XOOPS - header() 301 and 302 in englishin japanese

Archive | RSS |
PHP
PHP : header() 301 and 302
Poster : GIJOE on 2006-10-29 06:54:04 (11734 reads)

in englishin japanese
On site moving like PEAK XOOPS, we should return 301 instead of 302.
You should know php's header("Location:...") returns 302 if you don't send 301 additionally.
I've just fixed this


DocumentRoot
-- xoops_redirect.php
-- xoops/
---- .htaccess
---- index.html (dummy)


/xoops_redirect.php

<?php
$uri = strtr( substr( $_SERVER['REQUEST_URI'] , 6 ) , array( "\n" => '' , "\r" => '' ) ) ;

header( "HTTP/1.0 301 Moved Permanently" ) ;
header( "Location: http://xoops.peak.ne.jp".$uri ) ;
?>


/xoops/.htaccess

ForceType xoops_redirect
Action xoops_redirect /xoops_redirect.php

0 comments

Related articles
Printer friendly page Send this story to a friend

Comments list

Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!