I have a standard CMS-like RewriteRule
set up in my .htaccess:
RewriteRule ^(.+)$ index.php?slug=$1
Let's say I have a directory called foo
in the root directory. For some reason, if you hit the page it causes a redirect:
http://example.com/foo
redirects to http://example.com/foo?slug=foo
Removing the directory fixes the problem, but unfortunately, it's not an option. Does anyone know of a workaround?
foo
is a real directory on the filesystem, by defaultmod_dir
will append a slash, triggering an external redirect (as covener mentions in his answer). I explained more about this in an answer on StackOverflow: stackoverflow.com/a/31701005/369434