Forum Moderators: phranque

Message Too Old, No Replies

Removing the extensions (.html, .php etc)

anyone know any downsides?

         

londrum

10:59 am on Sep 23, 2007 (gmt 0)

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



someone mentioned to me the other day the benefits of removing the file extensions from your urls.
all of my urls end in .php, and apparently you gain a little (very little) security boost if you hide the fact that you are using .php.
so he suggested that i rewrite all of my urls like this instead...

from:
www.example.com/page.php

to
www.example.com/page

i have a lot of urls on most of my pages, so i reckon i'll shave off 120 bytes or so from each page, which might add up to quite a big saving over the entire site.

so it's a win-win thing to do.

but then it struck me -- will the search engines consider everything to be a duplicate? presumably they will regard
www.example.com/page.php and www.example.com/page as being the exact same page, but i don;t want to end up with duplicate penalties.

and i don't have access to the .htaccess file, by the way, so i can't use mod_rewrite.

anyone know for sure whether it will cause any problems?

encyclo

12:18 pm on Sep 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have access to the .htaccess file

In your situation, the advantages of removing the file extensions will be minimal, and the side-effects significant. You have two issues, firstly that your *.php pages are already indexed, and you would need to do a 301 redirect to avoid duplicate content issues. This would require mod_rewrite.

In more general terms, you can use Apache's content negotiation to have extensionless URLs, but even then you have to take care not to have several URL variations pointing to the same content.

So, in short - don't risk it - it's not worth the hassle.