I am building a .htaccess
file with a fairly complex ruleset.
One of the basic rewriting rules is this first line:
If a requested file exists physically, no rewriting, stop processing rules.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
this works well with one exception: When I access a directory with a trailing slash
www.example.com/directory/
directory
will not be recognized as existant, whereas
www.example.com/directory
will.
What can I do to make Apache recognize existing directories with a trailing slash as well?
Background info, I am already adding trailing slash to every request made without one (to cater for both /directory
and /directory/
requests.