Forum Moderators: open

Message Too Old, No Replies

googlebot and php

         

scorpion

5:05 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



I'm not too clear about how googlebot treats PHP, if it doesn't treat it at all and just sees the result page, what if your PHP code in the header reads something like:

"if user has no cookies, header refresh to page2.html, if they have cookies, just continue loading the current document". To a browser without cookies, they'd be refreshed to see page2.html, if they had cookies they'd see the current HTML section of the current page. So is googlebot like a user "without the cookies", or should I just consider googlebot like a webpage that opens my page using fopen and see what it gets that way...

Nick_W

5:09 pm on Dec 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



User without cookies, definately.

Nick

andreasfriedrich

5:15 pm on Dec 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What Nick wrote and it doesn't treat it at all and just sees the result page. A spider is just another useragent. All UAs do is request resources via the HTT protocol. Servers simply answer those questions by supplying a HTTP response message. Neither part in this communication process cares how the other works as long as it speaks valid HTTP.

Andreas

scorpion

5:56 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



so basically you can assume the php section is kind of like javascript, in the sense that it is ignored..a HTTP request means what is between the <head> tags (how about php header "Location: ...") and the <html> tags, I guess the real question is does googlebot correlate a requested URI resource with the ultimate destination, that is if you do a header("Location...) will it follow the 301 code and know it is a new page to index, what if the refresh is to the same page with the appending of a paramter (e.g. refresh $PHP_SELF . "?var=1")?

Nick_W

6:10 pm on Dec 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



in the sense that it is ignored

No, google does not 'ignore' it. It has no idea that it even existe. PHP is server-side, any UA just gets the html/whatever output of the page...

Nick

andreasfriedrich

6:18 pm on Dec 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



a HTTP request means what is between the <head> tags

No, a HTTP request is what the UA does to ask a server to send a certain page. The HTML document is contained in the body of the HTTP response message.

Andreas

optisoft

7:28 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



I am quite curious on this topic. I love PHP - It saves huge ammounts of bandwith, provides content and links in an automatically updated and organized fashion. The problem I'm running into is that I have no idea to googles capabilitys to read these more intense php files that contain the "meat" of my website. Does google read results from PHP declaired from functions produced from URL strings, assuming a put up a link on a static page like blah.php?search=blah1&organize=alpha where search calls a db query searching for the string and organize tells the function how to orgranize.

Im pretty certain that google will read minor PHP placed in the body of the page like
<?
echo "$blah1";
?>

But havnt seen proof it reads content in the body like
<?
alphadirinclude {"/usr/www/home/content/db", "10", $search}; // calls function coded at top of ducument
?>

"any" help would be helpful,
Nick

andreasfriedrich

7:31 pm on Dec 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



google does not 'ignore' [PHP nor will it read PHP]. It has no idea that it even exists. PHP is server-side, any UA just gets the html/whatever output of the page...

scorpion

7:38 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



yes, i think the idea is that php generates a standard HTML, google just sees the HTML, although I do believe google does detect server redirects...

ruserious

7:56 pm on Dec 8, 2002 (gmt 0)

10+ Year Member



Have a look at one of the many PHP-relates topics in this section (googlenews). Usually there are no problems. What throws google off though is when you are using session-ids. Google will not follow links with session-ids in them, some have reported that a GET parameter with sth. like &id=whatever is enough for google to ignore it. However normal parameters are not a problem (although the fewer you have the better).

Everything you do to cookieless users, you are also doing it to google. ;)

scorpion

12:22 am on Dec 9, 2002 (gmt 0)

10+ Year Member



Would I be correct to assume that all mod rewrites for a page on your site (to another page or to an external page) are completely transparent to google?