Forum Moderators: open

Message Too Old, No Replies

Redirect and http://

Do search engines "read" this?

         

zoobie

8:36 pm on Sep 23, 2003 (gmt 0)

10+ Year Member



I read earlier where search engines now read http:// in the pages head and can tell if the page is being redirected.
Is this true?
What's to keep us from using a little php script like:
header("Location: folder/page.php"); that avoids the http:// bit then sends you to the next page that has
header ("Location: [site.com...] in it's head?
Kind of a double redirect...
What say?
Thx :D

[edited by: zoobie at 9:06 pm (utc) on Sep. 23, 2003]

dougmcc1

8:54 pm on Sep 23, 2003 (gmt 0)

10+ Year Member



You might have read about a JavaScript redirect being used in the HEAD element. JavaScript is displayed in the code for SE spiders to read whereas PHP isn't.

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]

Dreamquick

8:56 pm on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you mean;

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

zoobie

9:05 pm on Sep 23, 2003 (gmt 0)

10+ Year Member



Ahh yes...I goofed on the second header...I changed it.
Should have been:header ("Location: [site.com...]
Anyway, so is using a php header ok to redirect or is the .htaccess preferred...or does it matter?
Thanks

Dreamquick

9:14 pm on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



AFAIK PHP and .htaccess both offer rather good redirect facilities... If you're only looking to do a redirect either method is perfectly adequate.

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

zoobie

9:23 pm on Sep 23, 2003 (gmt 0)

10+ Year Member



Ahh...Ok. Well, the reason I need this is because I was going to make a keyword friendly page for my bother's site and then have the SE's index it. Then, the user gets redirected to the main site.
Comments?
Thx

mat_bastian

10:27 pm on Sep 23, 2003 (gmt 0)

10+ Year Member



It might be playing with fire which is up to you, just don't be surprised if you wind up burned.