I have a webpage which uses PHP and I am using mod_rewrite to make simpler URLs like
RewriteRule ^login$ /php/pages/login.php [L]
What I want to do is to prevent the direct access to the directory /php. But if I use something like:
RewriteRule ^php - [R=404,L,NC]
at the end of the file even the rewritten URLs are prevent since the .htaccess is used in the subdirectory again with the rewritten URL. If possible I would not like to place another .htaccess to each directory.
I also tried RewriteCond with REQUEST_URI without any luck.
at the end of the .htaccess: