So basically i want 2 folders in root one is server and the other is public.
Folder server is secured by always goto server/routes.php
Folder public is free to goto wherever if that file or dir exist.
If URL is localhost/server(anything) it goes to the server/routes.php with the URL (anything)
If URL is localhost/(anything but server) and (anything but server) is not a file or a dir in public it goes to the public/index.html with the URL (anything but server) otherwise if (anything but server) is a file or a dir in public it goes to public/(anything but server) i.e. (a file or a dir)
Some exmaples:
- localhost/server
- server/routes.php
- $_SERVER['REQUEST_URI'] is empty
- localhost/server/users
- server/routes.php
- $_SERVER['REQUEST_URI'] is users
- localhost/server/users?orderby=name
- server/routes.php
- $_SERVER['REQUEST_URI'] is users?orderby=name
- localhost
- url is empty
- public/index.html
- localhost/users
- url is users
- public/index.html
- localhost/partials/users.html (that file exist in public/partials/users.html)
- public/partials/users.html
How would I do this logic in .htaccess?