redirect - PHP in a 404 script to 301? -


i want 301 large amount of old urls.

can via php in 404 script, or mess search engine results (them thinking pages not found)?

my current .htaccess:

errordocument 404 /404/ 

my 404/index.php script plan:

<? switch (rtrim($_server["request_uri"],"/")) {     case "/blah/foo" :         $redirect="/somewhere_else/";         break;     case "/over_here" :         $redirect="/over_there/";         break;     case "/etc/etc/etc" :         $redirect="/etc/and_so_on/";         break; }  if($redirect) {     header ("http/1.1 301 moved permanently");     header ("location: ".$redirect);     exit(); } ?> <html>     <head>         <title>404: page not found.</title>     </head>     <body>         <h1>404: page not found.</h1>     </body> </html> 

so, basically, redirecting isn't problem, don't want search engine think these pages "not found" or "think less" of them, or that...

is legit? google happy this?

sending location http header automatically sets status accordingly. it's documented , it's easy test firebug or browser's equivalent tool.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

python - cx_oracle unable to find Oracle Client -