★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/000960.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  PHP
  PHP and Search Engines

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   PHP and Search Engines
bramh
Junior Member
posted April 25, 2000 04:05 PM     Click Here to See the Profile for bramh   Click Here to Email bramh     Edit/Delete Message Reply w/Quote
This may be a stupid question:
Are (the popular) searchengines indexing .php3 files different then .html files? I could think of the idea that .php3 files have dynamic created page content and search engines do not want to index that.
I'm asking this question because I want to build a site completely in PHP with use of the include() function for headers, footers etc.

Shade
Junior Member
posted April 27, 2000 08:29 AM     Click Here to See the Profile for Shade   Click Here to Email Shade     Edit/Delete Message Reply w/Quote
quote:
Originally posted by bramh:
This may be a stupid question:
Are (the popular) searchengines indexing .php3 files different then .html files? I could think of the idea that .php3 files have dynamic created page content and search engines do not want to index that.
I'm asking this question because I want to build a site completely in PHP with use of the include() function for headers, footers etc.

Well if ALL your pages have PHP in them, then just configure Apache (or whichever server you use) to parse all .HTML files for PHP code. Problem solved :-)

------------------
--
Does anyone else find it kinda perverse that we're using a Perl BBS to discuss PHP? ;-)

bramh
Junior Member
posted April 27, 2000 01:55 PM     Click Here to See the Profile for bramh   Click Here to Email bramh     Edit/Delete Message Reply w/Quote
Thank You, that's a nice one. But do you think that search engines behave different on indexing .php3 files?

Anyway, when I configure Apache the way you said is there a problem with HTML files which contain no php?

Spyder
Junior Member
posted April 27, 2000 08:51 PM     Click Here to See the Profile for Spyder     Edit/Delete Message Reply w/Quote
It shouldn't matter what the extension is that you use... Just as long as you don't plan to use the query string. For example:
page.php?a=1 or page.html?a=1

Not all search engines can list pages that containt the ? in URL. There is a way around this. Check out the article at PHP Builder.com about this: http://www.phpbuilder.com/columns/tim19990117.php3

spaceman
Member
posted June 26, 2000 03:52 AM     Click Here to See the Profile for spaceman   Click Here to Email spaceman     Edit/Delete Message Reply w/Quote
A few months ago I 'php-ised' a site that used to be just 'flat' HTML pages. So a page such as 'index.html' got renamed as 'index.php' after php script was inserted. The re-developed site worked great and the client was very happy. Over the next few weeks and months the 'hits' on the site reduced dramatically. We initially could not explain why this should be happening, and then we stumbled upon the idea that maybe search engines prefer pages that have a .html or .htm extension. Our solution? We re-configured our Apache web server to parse files with .htm for php script, renamed all the .php pages to .htm, and watched as the web site stats slowly improved over the subsequent weeks.

So I'm pretty convinced that unless a web page has a .htm or .html file extension, it is NOT particularly search engine friendly. I only wish I could find some 'official' word on this subject from either the help pages of the search engines themselves, or from the 'elite' php community who might be able to shed more light.

I love php, but if it's true that php-style extensions on a web page (eg. .php, .php3, .phtml, etc.) cause pages to suffer at the hands of search engines, then php developers should be made aware of this through respected sources. Hey, I know that prominent search engine placement is not the final word in whether or not a site is successful (far from it), but developers should be aware of this issue nevertheless.

Ross.

rod k
Member
posted June 26, 2000 06:14 AM     Click Here to See the Profile for rod k   Click Here to Email rod k     Edit/Delete Message Reply w/Quote
Spaceman is correct. Some engines are purposely not indexing .php .asp .jsp etc pages.

Many don't like the solution of making all .html pages parsable due to the hit if they have a lot of static pages. The solution: make .htm a PHP parsable extension and label your PHP scripts with the .htm extension and static pages .html

Aoeex
Junior Member
posted June 26, 2000 05:21 PM     Click Here to See the Profile for Aoeex   Click Here to Email Aoeex     Edit/Delete Message Reply w/Quote
quote:
Originally posted by rod k:
The solution: make .htm a PHP parsable extension and label your PHP scripts with the .htm extension and static pages .html

Good solution but I am doing the same thing with my site, using include to inster headers, and footers and a few other things. Now my problem is that I can't change the way apache works. So i need to have mine as a .php3 file. Any ideas on how I can deal with this problem?

rycamor
Member
posted June 27, 2000 12:32 AM     Click Here to See the Profile for rycamor   Click Here to Email rycamor     Edit/Delete Message Reply w/Quote
This second part of this idea is a little out there, but if your site structure is not too complicated, just place the major files you want indexed as index.php files in their own directory. That way the search engines never even know what the extension is, they are just index home pages in each directory.

If your site structure is complicated and requires passing many variables in the URL, try making use of $REQUEST_URI or other environment variables, so it looks as if you are calling a directory, when really you are calling an index.php page with a variable. You achieve this in Apache by changing the ErrorDocument 404 directive to point to index.php (or whatever file you want)

ex.
calling http://www.yourserver.com/helpdesk/

actually calls http://www.yourserver.com/index.php with a $REQUEST_URI value of "/helpdesk".

You can even point to .html files that don't exist, but present a variable for the PHP page to act upon.

It's a crazy solution but could prove useful. You could even hide entirely from the user the fact that your site uses any server-side scripting at all.

cwilhoit
Junior Member
posted June 27, 2000 09:52 AM     Click Here to See the Profile for cwilhoit   Click Here to Email cwilhoit     Edit/Delete Message Reply w/Quote
So how exactly do you set up Apache to parse html as php? In the "AddType application/x-httpd-php3 .php3 .html" ? or some"AddHandler" ?

Hoit

[This message has been edited by cwilhoit (edited June 27, 2000).]

WizActive
Junior Member
posted June 28, 2000 04:48 AM     Click Here to See the Profile for WizActive   Click Here to Email WizActive     Edit/Delete Message Reply w/Quote
yep. that's the place

cwilhoit
Junior Member
posted June 28, 2000 05:07 PM     Click Here to See the Profile for cwilhoit   Click Here to Email cwilhoit     Edit/Delete Message Reply w/Quote
So if I just add ".html" to the "AddType" for PHP, save and the restart Apache then every page with a ".html" extension will be parsed for PHP code? Could I not do this within a virtual host to cut back on unnecessary parsing of ".html" files that do not have any PHP code?

Hoit

rod k
Member
posted June 29, 2000 12:54 PM     Click Here to See the Profile for rod k   Click Here to Email rod k     Edit/Delete Message Reply w/Quote
Yes, you can. You can also do it at the directory level.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.