I think the most common way developers do this (on Linux/Apache/PHP servers anyway) is to use the apache mod_rewrite module. This module lets you define rules so that a user request for a particular url is mapped onto a different URL behind the scenes. For example, you might set up a mod_rewrite rule like this:
RewriteRule ^(.*)$ /index.php?arg=$1
which, if i've entered it correctly would take any url such as http://yourdomain.com/some/path/or/args and map it onto http://yourdomain.com/index.php?arg=/shome/path/or/args
Then, in your index.php file you could check the value of $_GET['arg'] for the path they had entered and respond accordingly by querying a database or whatever.
NogDog's suggestions are also good recommendations, but each different url you want to support would require its own PHP file.