I found the answer here at Gareth Jones's blog:
Passing all requests to a single PHP script
I needed all requests with a certain URL prefix to be handled by a single script. This was easily solved using the following URL re-writing rule in a .htaccess file:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^.*$ index.php
Note that I had to enable the mod_rewrite module in Apache and ensure that directives could be overridden with the following:
<Directory /var/www/>
AllowOverride All
</Directory>
Determining the full requested URL
Another requirement of my application complicated by URL rewriting was that I needed access to the full URL. I achieved this with the following bit of code:
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$location = $_SERVER['REQUEST_URI'];
if ($_SERVER['QUERY_STRING']) {
$location = substr($location, 0, strrpos($location, $_SERVER['QUERY_STRING']) - 1);
}
$url = $protocol.'://'.$_SERVER['HTTP_HOST'].$location;