Unexpected htaccess behaviour (mod_rewrite and apache)

Posted by avastreg on Stack Overflow See other posts from Stack Overflow or by avastreg
Published on 2010-06-08T15:13:21Z Indexed on 2010/06/08 20:52 UTC
Read the original article Hit count: 190

Yeah, mod_rewrite is driving me crazy.

Here is the problem:

my htaccess

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$    index.php?url=$1 [L,QSA]

when i try to access the page advantix (so address was www.mywebsite.com/advantix), i'm being redirected to advantix/?url=advantix

Looking at the access log, i have a suspicious 301 in the middle

"GET /advantix HTTP/1.1" 301 335 "-" "Mozilla/5.0"
"GET /advantix/?url=advantix HTTP/1.1" 200 186 "-" "Mozilla/5.0"

There is one important detail: advantix is a directory.

So, if i comment that rule, advantix goes to the folder and list the files.

Why it applies automatically the / if there's a folder matching?

I don't want to reach the folder, i want to reach index.php?url=advantix with a call to advantix.

I have the rewriteLogs too, but they didn't help more. My vhost conf has Directory tag with Options All, if helps, i don't know much about that.

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess