| ★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/000960.html | Nouvelle recherche | Portail wanayoo |
|
|
DevShed Discussion Forums
![]() PHP
![]() PHP and Search Engines
|
| next newest topic | next oldest topic |
| Author | Topic: PHP and Search Engines |
|
bramh Junior Member |
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 |
quote: 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 :-) ------------------ |
|
bramh Junior Member |
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 |
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 |
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 |
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 |
quote: 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 |
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. 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 |
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 |
yep. that's the place |
|
cwilhoit Junior Member |
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 |
Yes, you can. You can also do it at the directory level. |
All times are MST (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1997-2000 ngenuity. All rights reserved.
Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.