Forum Moderators: open
[edited by: zoobie at 9:06 pm (utc) on Sep. 23, 2003]
Instead of using PHP, you can tell your .htaccess file to do the same thing.
<added>
Or after reading Dreamquick's post, I might have read you wrong completely :)
</added>
[edited by: dougmcc1 at 9:08 pm (utc) on Sep. 23, 2003]
If you take your normal redirect and put http:// in front of it will it be hidden from search engines? Then yes, but only because that redirect will no longer work for either search engines or users because it'll find that "preferredpage.html" is not a valid domain name.
If you mean can you do two redirects, one internal, one external to fool a search engine spider into believing it still following an internal redirect? Then probably not, as in order to follow redirects a search engine has to know which domain / path it is being redirected to, and while these two may look different to you, in order to follow them a search engine would have to parse them at which point they would both be full expanded and it would be apparent which domain each one is referencing.
header("Location: folder/page.php");
header("Location: http;//domain/preferredpage.html");
Once you realise that then you have to question any logic that says they can't follow multiple redirects.
If all you want to do is stop a search engine seeing where the redirect is going why not use a separate script to handle the redirect and then deny access via robots.txt? That way you get something that looks like an internal link, but could actually take you anywhere, even external sites.
- Tony
The only really difference I know of is that PHP would normally require a physical page to do the redirect while htaccess can just be configured to issue a redirect without an actual page needing to exist.
- Tony