DirectoryIndex /handle_request.php
## There must be an empty file named home
RewriteEngine On
# If it's a php file, internally redirect to handle_request
RewriteCond %{REQUEST_URI} !^/handle_request.php$
RewriteCond %{REQUEST_FILENAME} ^(.+).php$
RewriteRule ^(.+)$ /handle_request.php [QSA,L]
# if it's not handleRequest, then prepend /Public to the request uri internally
# some logic needs to be added so that if /Public/url is requested directly,
# the /Public part should be removed from the visible url
RewriteCond %{REQUEST_URI} !^/handle_request.php$
RewriteCond %{REQUEST_URI} !^/Public
RewriteRule ^(.+)$ /Public/$1 [QSA,L]
# Rewrite any not-found file to handleRequest
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /handle_request.php [QSA,L]