Forum Moderators: phranque
RewriteRule ^inc/?$ / [F,NC,L]
It works great! But, what happens if i have another directory inside inc/, which is called 'important'
Is there a way for me to implement a rule that redirects the user if he tries to access inc/ or any of its subdirectories?
RewriteRule ^inc/(.+)/?$ /inc/$1/ [NC,L]
Note that this doesn't really redirect anywhere (not sure if you have a specific file you want loaded if someone tries to list the directory). If no redirection is needed, you should just use a RewriteCond.
RewriteCond %{REQUEST_URI}!^/inc/.+/ [NC]
RewriteRule ^inc/?$ / [F,NC,L]
RewriteRule ^inc/? - [NC,F]
Jim