On Mon, Feb 09, 2004 at 02:31:16PM -0500, Lowell Allen wrote: > A recent thread on the WebDesign-L raised the question of whether search > engines can detect (and penalize sites for) PHP redirects of the form: > > header("Location: http://www.whatever.com/"); > > I don't see how that could be the case, since the redirect occurs on the > server before any HTML is output to the browser. Someone else says: > > > No, the header() redirect immediately tells the /client/ to make a second > > GET request at a different location and the client (search bot) must > > actively make that 2nd request to the "Location:" URL (what happens if you > > request amazon.com) Note this is different from simply sniffing the UA > > string from a single request and serving altered content.
This is accurate (the explanation from webdesign-l). Try it yourself: === $> telnet www.yourserver.com 80 Trying 123.456.789.000... Connected to www.yourserver.com. Escape character is '^]'. GET /path/to/redir.php http/1.0 host: www.yourserver.com HTTP/1.1 302 Found Date: Mon, 09 Feb 2004 19:49:35 GMT Server: GoGoGadgetWebserver/0.3 Location: http://www.example.com/ Connection: close Content-Type: text/html Connection closed by foreign host. === Assuming redir.php contains a header() call that sends "Location:", the bot will see something like that. It's up to them to parse that, determine the status code (302, in this case), and decide what to do with it. Browsers just do this transparently. > What say you, PHP list? Would it be better (in terms of search engine > detection) to use include() to serve different or altered content? Do neither. Create excellent content, structured well, and the search engines will reward you for this. Try to trick them, and they will likely figure it out and penalize you. However, if you're asking whether or not Google can determine if you're using include() to serve up different content based on the UserAgent or perhaps the IP address, then no, bots can't figure that out. Unless they switch useragents/IPs and compare the results that they get. Or unless a human complains that the listing is innacurate. etc... -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php