Forum Moderators: coopster

Message Too Old, No Replies

Is a PHP extension a good, bad, or nothing?

using mod_rewrite to change extensions

         

Storyman

8:09 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



All of the files on the site have a PHP extension. Using mod_rewrite the pages will show as having a HTML extension. All of the internal links have been set to reflect the HTML extension of the files.

The question is when the site is spidered will the search engine list the file as PHP or HTML.

The dilemma is if it just spiders the directory it will see PHP files. On the other hand if it follows the links it will see HTML pages.

BTW none of the pages have a? at any time.

Does it matter that the spider could potentially see a php or html page?

Will the scenario have any impact on the ranking?

Are there other issues that I need to be made aware of?

deejay

8:42 pm on Oct 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never seen a spider actually plow through a directory.

Once you slap up that index page it effectively blocks the spider from seeing the directory listing, and you then direct the spider around your files via the links you place on the page.

So if all your site linking is consistently referring to the html pages I can't see a problem.

Longhaired Genius

9:17 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



For the sake of anyone else who might be thinking of doing this, I have to say I think it's a waste of time. The search-engines are not stupid. The web is full of php; any search-engine that couldn't or wouldn't index it properly wouldn't last long.

Storyman

10:01 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



Deejay & Longhaired Genius,

Thank you both for the feedback.

Longhaired Genius, I agree with you that it would be a waste of time if there is any expectation to help with search engine ranking.

There are two reasons that it was done. The first (and less significant) is to assure those users who habitually type index.html as part of the url. Granted, it is a small percentage, but still a percentage.

The more significant reason is for security.

PatrickDeese

10:08 pm on Oct 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could always have your server parse .html extensions for PHP that is what i do with my sites - especially the ones with hereditary URLs.

ergophobe

3:46 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




The more significant reason is for security.

Security? You mean so that hackers won't know that you are running PHP? This "security through obscurity" has little value.

Sorry for sounding like a broekn record, but the best solution, if you're going to the trouble, is to have your "canonical urls" (shortest url that points to a given resource) have no extensions at all.

- same security benefit (albeit tiny)
- shorter urls
- urls are completely technology independent

What about people who type

h**p://example.com/path/to/file.php
h**p://example.com/path/to/file.html
h**p://example.com/path/to/file.htm

instead of
h**p://example.com/path/to/file/

You can easily use mod_rewrite or some PHP scripting to allow all four to work.

Remember
Choose URIs Wisely [w3.org] and Cool URIs Don't Change [w3.org] (see the footnote)