If all CMS’s (Drupal, MediaWiki) are just a collection of PHP or ASP in the background, then how do they display pages at http://www.example.com/directory/ or http://www.example.com/File_name without extensions or anything?
Is this some .HTACCESS configuration? Python? Perl? What could do this?
How could I do this for my server/websites? (Without using a CMS?)
You are after URL Rewriting. It enables the webserver to show content for URLs that do not map directly neither to the content present in the filesystem nor to a specific dynamic content handler (which are the two usually standard ways to serve content).