I created an application using the Front Controller pattern, so basically everything is sent to index.php
This is what I currently have in my .htaccess file
RewriteRule ^([a-zA-Z0-9]+)(\/([a-zA-Z0-9]+))?(\/([a-zA-Z0-9\/]+))?(\/)?$
index.php?class=$1&method=$3&args=$5
(I had to break the line into two, for presentation but you know what I mean)
So it works fine however if I create a directory named /js for example that has to be directly accessible. That means, I can’t put an .htaccess file inside it and put:
Deny from all
Then accessing my site using the URL http://mysite.com/js redirects to http://mysite.com/js/?class=js&method=foo&args=
Putting Options -Indexes in the main .htaccess file doesn’t really help. Any thoughts?
Any clarifications are welcome, I’m not really an good at explaining things.
Thanks
Use
Exclude real files and directories from the redirection rule (redirection rule will not apply to the real files and directories).