views:

19

answers:

4

for example if in my index.php i have something like:

<?php
header('Location: /mypublicsite/index.php');
?>

what do the crawlers and/or robots get? just a blank page? or they actually arrive to /mypublicsite/index.php?

A: 

They arrive at the target of the redirection.

nikic
+1  A: 

Initially, they get a blank page, with a header saying they should load a different page instead. The client has to load the new page itself.

Robots do understand the Location directive, and will load the new page instead.

You have to understand though you should stop the execution of your php script yourself, because the Location header can be ignored.

So something like this:

<?php
header('Location: otherpage.php');
echo $secret;
?>

is unsafe, because $secret will be sent to the client.

Ikke
A: 

The header information of the document will be read by the crawler. The robot will go to the url because the location entry tells everybody to redirect to the given URL.

VeeWee