www.site.com/site/
instead of
www.site.com/site/index.php
www.site.com/articleName/
instead of
www.site.com/articleName.php
Its been around for so long, but I can't seem to find an article about it anywhere!
I know you can simply do it with directories and index.php files, but I'm sure most sites don't do it that way...
How do these guys do it? And apart from the URL looking nice and clean, what benefits does it gain?
For Apache/PHP mostly (.htaccess) rewrite rules are used. For IIS/ASP sites a URL rewrite module is usually used but there are many other techniques (like: a 'special 404-handler' that handles all non-existing URL's and figures out how to process the request).
Rewrite rules can be(come) very complex or very simple; a rewrite rule can be used for every method (or action) in the url or it can be as simple as passing every request to the same "index.php" (or equivalent) and letting the code handle the rest of figuring out what to do.
Why it's done? Mostly because of SEO reasons or "easy to remember url's" (who types in complete urls nowadays anyways?) or "user friendly url's". You might want to check out this article on wikipedia which also states
The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the outside world.
as a reason and summmarizes some drawbacks and benefits. Even more can be found here.
One way is to use Apache's mod_rewrite module.
I'm sure there are others...
You can use modrewrite on linux, isapi rewrite for iis 6 or 7 or url rewriting module for iis 7.5+.
Search for [friendly-url]
here in SO to find dosens of answers.