Welcome to WebmasterWorld Guest from 54.162.157.249

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP and Google indexing

How does Google handle php code

     
3:05 pm on May 30, 2002 (gmt 0)

10+ Year Member



Currently my site uses php code to include common file information and to set session variables and to update and access database information.

Can someone explain how the search engines will handle the following?

1 - When I use an "include" statement in my file (the file is named index.php3) -- what does the search engine actually read? Just the code that displays in the View Source page at the browser -- or all the php code from the include file and other php code in the file? Since the php code does not display in the browsers View Source -- I was thinking the search engine does not read this code -- but only the code I am actually seeing in the View Source page?? I am trying to determine how much code the search engine is actually reading through before seeing my key terms on the page.

2 - Is it OK to use a php variable in a <a href>link</a> tag? For example can I use <a href="http://www.somedomain.com/dir<?php$Enviroment?>/junk"> as an affective link that Google will spider correctly? Or do I need to use a static link without the php variable?

3 - What are your thoughts on the rankings a search engine gives to a file with a php extension compared to files with a html extension? I am referring to static php files -- not a page created on the fly.

Thanks!

3:41 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi

Most of those questions can be answered by telling you this:

PHP is a server-side scripting environment. The browser, the user (and that includes search engines) will never see one line of your php code.

Whatever your PHP code outputs to the browser will be seen though.

The only thing to avoid is urls like: mysite.com/?id=34&nw=tytyty

because currently only INK and Google will index those pages.

There is no difference in .php or .html as far as I'm aware with regard to ranking.

Hope that helps!

Nick

3:42 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) Search Engines only see the HTML source you see when you do a view source in your browser.

2) Yes, you can place PHP tags anywhere. <? echo $I; ?>

3) Search engines do not care what extension you use. For that matter PHP doesn't care what extension you use either. You may tell PHP to parse HTML files as well.

5:23 pm on May 30, 2002 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



[quote]
You may tell PHP to parse HTML files as well.
[quote]

Not to be too picky, but you can't tell PHP to parse HTML - you tell Apache or whatever server you use to send files ending with .html (or whatever) to the PHP parser. These configurations are set in httpd.conf (in Apache) and not in php.ini.

Tom

5:26 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You forgot the 'na na na na na na!' Tom

;)

5:36 pm on May 30, 2002 (gmt 0)

10+ Year Member



Thanks for the help!
7:50 pm on May 30, 2002 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



na na na na na! :)
1:04 am on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not to be too picky

A DOC file is something.doc So when I say HTML files I mean something.HTML, I did not say HTML formatted files. I think everyone understood. So you DID mean to be picky. ;)

na na na na na!

7:33 pm on May 31, 2002 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month




So you DID mean to be picky.

Okay, mea culpa, mea culpa, mea maxima culpa....


A DOC file is something.doc So when I say HTML files I mean something.HTML, I did not say HTML formatted files.

That wasn't my point at all. What I was trying to say is that if the original poster was trying to set this up, he would tell his APACHE not PHP to parse the file as PHP. I was trying to avoid confusion (talk about ironic :) ) by pointing out that he would have to modify httpd.conf (i.e. tell Apache) and not php.ini (i.e. tell PHP).

Oh well.... I'm on vacation for two weeks with computer access, so you won't have me to kick around... ou wait that was Nixon... I mean, you won't have me to put up with for while (sorry to foreigners and those too young to remember the reference).

Tom

Tom

 

Featured Threads

Hot Threads This Week

Hot Threads This Month