0

The benefits of hiding a file extension that I know of are user-friendly URLs, and a thin layer of security (I say thin because if someone really wanted to find out the extension of a file whose type has been hidden, it probably wouldn't be difficult. Am I wrong?).

But why should you do this (hide the extension), rather than use a file of type "file", with no extension? For example, if I have an extension-less file named "404", <a href="/path/to/404">Error page</a> works without error (pretend I have absolutely no IE visitors).

Is there any added benefit of actively hiding the extension of a file that has one, over using files that don't have extensions? See any linked pages from schema.org for an example.

Trojan
  • 2,256
  • 28
  • 40

2 Answers2

1

You hide the file extensions because it is Good Design.

The idea is that URIs and URLs are independent of implementation and the user should not bother about what type of file he is looking at, whether .php or .html. If I want to look at a page on the latest Fender Strats, I should just go to something like www.fender.com/strats/latest and get all that I need.

The added benefit is that the URL remains "Uniform" and you don't have to change it (especially when the user bookmarks your site), if one day you decide to shift from php to Django or Rails.

varagrawal
  • 2,909
  • 3
  • 26
  • 36
-1

Shorter urls are one benefit of leaving out the extension?

vogomatix
  • 4,856
  • 2
  • 23
  • 46