DirectoryIndex /Server/handleRequest.php
## There must be an empty file named home
RewriteEngine On
# If it's a php file, internally redirect to /Server/handleRequest
RewriteCond %{REQUEST_URI} !^/Server/handleRequest.php$
RewriteCond %{REQUEST_FILENAME} ^(.+).php$
RewriteRule ^(.+)$ /Server/handleRequest.php [QSA,L]
# if it's not handleRequest, then prepend /Public to the request uri internally
RewriteCond %{REQUEST_URI} !^/Server/handleRequest.php$
RewriteCond %{REQUEST_URI} !^/Public
RewriteRule ^(.+)$ /Public/$1 [QSA,L]
# Rewrite any not-found file to handleRequest
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /Server/handleRequest.php [QSA,L]