Page 1 of 1

Using php include() with google

Posted: Fri Sep 17, 2004 6:14 am
by reverend_ink
I would post this in code area but it really isnt a code question, its a usability question.

Has anyone figure dout how to use include(file.php) with google and get that file to be spidered properly?

I have a few sites I am working on that all use header files and none of that information is being listed by google....

Thanks all!

Posted: Fri Sep 17, 2004 9:35 am
by JayBird
That is weird because google will see exactly what your broswer sees, it cannot see PHP code.

Posted: Fri Sep 17, 2004 10:05 am
by Draco_03
Whatever reason it is, it is not because of the includes

Posted: Sat Sep 18, 2004 3:36 pm
by reverend_ink
Draco, it is the includes as googlebot doesnt parse included files or javascripts, much like the lynx browser.

I was just wondering if anyone had figured out a way around this...

Taking out the include is not an option I have.

Posted: Sat Sep 18, 2004 5:02 pm
by cravikiran
reverend_ink, I am not sure if you understood the include commnet. Like Bech100 said, Google will see whatever you see in your browser, that is, it sees what's outputted by your PHP script. Therefore, the internals (including include()) of your script will not matter. Google will simply follow the link structure that exists in the HTML outputted by your script.

Posted: Sat Sep 18, 2004 5:33 pm
by John Cartwright
It is impossible for anyone or anything to get your php code. It will always be parsed to HTML

Posted: Sat Sep 18, 2004 6:01 pm
by reverend_ink
If you go here http://www.google.com/webmasters/guidelines.html you will see that google does not parse includes. It doesnt ignore your code but does not prse the include, much like Lynx. If you download and use Lynx you will see that that information is not viewed in the browser, and googlebot uses a similar system to read your pages.

It isnt that google doesnt see the php output, it just cant read the includes.

Posted: Sat Sep 18, 2004 6:13 pm
by feyd
the inclusion is done on the server side.. way before the browser sees it.

Posted: Sat Sep 18, 2004 7:23 pm
by d3ad1ysp0rk
reverend_ink wrote:If you go here http://www.google.com/webmasters/guidelines.html you will see that google does not parse includes. It doesnt ignore your code but does not prse the include, much like Lynx. If you download and use Lynx you will see that that information is not viewed in the browser, and googlebot uses a similar system to read your pages.

It isnt that google doesnt see the php output, it just cant read the includes.
Google sees the HTML.

By includes I believe they were talking about iframes or javascript/css links?

But could you show where it says they dont do include pages?

Posted: Sat Sep 18, 2004 9:46 pm
by qads
rev is talking about this i think
Goooooooooogle wrote:If you decide to use dynamic pages (i.e., the URL contains a '?' character), be aware that not every search engine spider crawls dynamic pages as well as static pages. It helps to keep the parameters short and the number of them small.
Keep the links on a given page to a reasonable number (fewer than 100).

Posted: Thu Sep 23, 2004 4:37 pm
by leewad
Thats Right !!

Most pages with a ? will not get spidered - You can get around this by by using Mod_Rewrite so instead of having a page like:

http://www.mydomain.com/index.php?lanuage=english

you Mod_Rewrite it to beocome

http://www.mydomain.com/english.html

This will then get spidered - But by no means will Google not index a page if it has a include(""); file in !

I have got most of my pages indexed in google and I use lots of includes

Hope this helped a little :wink: