Hi everyone! I did not realize that .htm and .php had such a difference in spidering with search engines until researching it on this forum. When i brose around now, i notice it and it's quite interesting... My question is, what does it take to run php code and makes your webpages look like they're .htm pages? Is it as simple as a piece of code? Or as complex as installing something onto the server that the site is hosted on? I'm quite confused... Thanks so much for any and all info!
my webhost has software installed so that I can run php code in any type of page. So I can run a script and call the page store1.html. It just takes a little more time to load ( not noticable on broadband or dsl) . I had to have my host allow this for me, but I have another site where this type of coding was allowed with no support request required. BTW IMHO the page extension has nothing to do with spidering. Its the URL whether it is dynamic or static. Its a myth that .php pages rank worse than .html.
All it takes is mod_rewrite in your .htaccess file. But, I think you've got a misconception. site.com/keyword.html doesn't have any more value or search engine favoritism over site.com/keyword.php The reason people mod_rewrite php is to get rid of url's like site.com/index.php?t=239352&id=324324 (that is addresses with multiple variables).
Well, i see quite a few php forums (bullein boards) changing the way their links are shown. They seem to be either straight directories or .htm/.html files instead of php. I have a lot of dynamic content from my database and would love to make it more easily spidered... Just not sure how big of a project it would really be... Could you elaborate on the .htaccess file and what i would need to do with it (just to get an idea)?
easy add into apache httpd.conf AddType application/x-httpd-php .php .phtml replacing the bit in bold with whatever file extension u want to be parsed my php once httpd.conf is updated restart apache voila
I use this in my .htaccess file: RewriteEngine on RewriteRule ^(.*)\.html$ $1 [C,E=WasHTML:yes] # rewrite to document.php if exists RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [S=1] # else reverse the previous basename cutout RewriteCond %{ENV:WasHTML} ^yes$ RewriteRule ^(.*)$ $1.html Code (markup):
That's great to know as I've been 'believing' the myth. Now, if I use an INCLUDE file as my navigation menu, will the links be followed by spiders? (no variables in urls, just straight xxxx.php) Thanks for your help!
yes because the include is rendered by the server at the time of page request. The spider sees what you see when you "view source"