Forum Moderators: open

Message Too Old, No Replies

php google question

         

scorpion

8:07 pm on Nov 2, 2002 (gmt 0)

10+ Year Member



How would google index this page? index.php

<?php

header("Location: redirect URL");

?>

Will google index the ultimate redirect or is it more like javascript, namely it can't understand it at all.

Nick_W

8:16 pm on Nov 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It'll understand it. PHP is server-side but, I'm not sure it will like it....

Nick

john316

8:26 pm on Nov 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a php eqivalent to a 302, moved permanently?

Nick_W

8:32 pm on Nov 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could send that using header() but I'm not sure of the exact syntax for 301's

Better off with .htaccess

Nick

andreasfriedrich

8:48 pm on Nov 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is no php eqivalent to a 302, moved permanently but there is a way to send such a HTTP message using php:

<?php 
header('HTTP/1.0 301 Moved Permanently');
header("Location: redirect URL");
?>

Not only does it [the Location header] send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.

[php.net ]

Andreas

john316

9:51 pm on Nov 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks andreas

I got my 1's and 2's mixed up.