Using php include() with google

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
reverend_ink
Forum Contributor
Posts: 151
Joined: Sun Apr 20, 2003 1:18 am
Location: Las Vegas | London

Using php include() with google

Post 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!
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

That is weird because google will see exactly what your broswer sees, it cannot see PHP code.
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Whatever reason it is, it is not because of the includes
reverend_ink
Forum Contributor
Posts: 151
Joined: Sun Apr 20, 2003 1:18 am
Location: Las Vegas | London

Post 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.
cravikiran
Forum Newbie
Posts: 7
Joined: Sat Sep 18, 2004 4:55 pm

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

It is impossible for anyone or anything to get your php code. It will always be parsed to HTML
reverend_ink
Forum Contributor
Posts: 151
Joined: Sun Apr 20, 2003 1:18 am
Location: Las Vegas | London

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the inclusion is done on the server side.. way before the browser sees it.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post 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?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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).
leewad
Forum Commoner
Posts: 91
Joined: Tue May 11, 2004 8:32 am

Post 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:
Post Reply