This is done through .htaccess rewriting. Plenty of other examples can be found on Google.