added proper support for directory redirects, fixed some issues with
REQUEST_URI, and public_folder will default to cwd