How do I make all URLs run through a single PHP file?
If you are using Apache, use rewrites via mod_rewrite
:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
This will rewrite your URLs to »index.php?q=foo/bar/baz« transparently.
The 2. and 3. lines tell the rewrite engine not to rewrite the URL if it points to an existing file or directory. This is necessary to have access to real files provided by the httpd server.