What I am trying to achieve (with mod_rewrite) is on request check if a file/directory exists in the public folder, if it does, serve it, if not, route the request to the index.php file. Also if no extension provided in the URL then default to .html.
Below is my folder structure:
/.htaccess
/index.php
/public
/test.html
/test.xml
/a_folder
/index.html
/test.html
So for example here are a few requests and responses:
- example.com/test.xml >>> /public/test.xml
- example.com/a_folder/ >>> /public/a_folder/index.html
- example.com/a_folder/test >>> /public/a_folder/test.html
- example.com/not_in_public >>> /index.php
Any pointers on this would be amazing, thanks in advance.
Thanks to @jxpx777 and @N1xx1 after a bit of juggling made it work.