I’ve been looking around the internet and haven’t found out how, but have found hints that it’s possible to redirect a subdirectory back to the root URL. I’m using logical URLs by way of the .htaccess RewriteRule to mask php files(example being http://my.domain.tld/search/foo/ instead of http://my.domain.tld/search.php?query=foo).
What I want is to have all of my php files in a subdirectory that can’t be accessed, such as my.domain.tld/php/searches/search.php, and have any urls that go to /php/ on my server it automatically redirects back to my.domain.tld instead.
Any help pointing me in the right direction?
Add .htaccess file into your php directory with the content