Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example the web page I'm on now is:

http://superuser.com/questions/ask

not:

http://superuser.com/questions/ask.html

http://superuser.com/questions/ask.php

I've noticed this for all kinds of sites. Do the developers just not bother putting suffixes on the files?

share|improve this question
up vote 5 down vote accepted

It's important to remember that a URL is a way to specify a resource. This resource can be of any type. In simpler sites, the resource is requesting a file located in a given folder on the server. But it is become much more common for the URL to be less of a direct 'give me this file', and instead be parsed by a web engine.

In these more advanced sites (or at least more driven by custom software), the URL is more a directive to the software rather than a specifier for a particular file, and so has no reason to include an extension (which is merely a way for operating systems to conveniently tell what kind of file something is).

You are not requesting a file on a site like superuser; you are making a query against a API (so to speak). So it has no need for a file extension.

share|improve this answer

StackExchange is an ASP.NET MVC application. MVC means Model, View and Controller. The URL http://superuser.com/questions/ask is saying go to the 'questions' controller and find me the 'ask' method which will then turn around and render a view back to the user. So in one way you're not actually navigating to a page, you're navigating to a programatic method located on the web server.

Secondly, there are other sites which may have a URL like http://superuser.com/questions/ask which are actually re-writing the url in the background so instead of http://superuser.com?q=123&a=789, you'll get the pretty URL of http://superuser.com/questions/ask. This type of background work can be found in applications like WordPress.

Hope this helps explain this for you.

share|improve this answer

These "files" are often actually directories. Most servers allow a developer to specify a default index file (usually index.html), such that the URL for a directory can be entered without the individual filename. For example, Apache will allow you to configure this using the DirectoryIndex directive in the .htaccess file:

DirectoryIndex index.html

And then a request for the directory containing an index.html will be served with the index file.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .