RewriteRules targeting a directory result in a gratuitous redirect

Posted by MapDot on Pro Webmasters See other posts from Pro Webmasters or by MapDot
Published on 2011-02-17T15:45:06Z Indexed on 2011/02/21 23:34 UTC
Read the original article Hit count: 380

Filed under:
|
|
|

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://www.mysite.com/foo --> http://www.mysite.com/foo?slug=foo

Removing the directory fixes the problem, but unfortunately, it's not an option. Does anyone know of a workaround?

© Pro Webmasters or respective owner

Related posts about apache

Related posts about mod-rewrite