mod_rewrite changes case even if not matching RewriteCond?

Posted by kirdie on Server Fault See other posts from Server Fault or by kirdie
Published on 2012-12-05T15:33:09Z Indexed on 2012/12/05 17:06 UTC
Read the original article Hit count: 213

Filed under:
|
|

I have a really strange problem with my MediaWiki which I want to have articles of the form mywiki.org/MyArticle. Now I got most of it to work using the following code but it mysteriously cannot display the logo anymore.

RewriteEngine On
# don't rewrite valid requests to files and directories
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
# mywiki.org/MyArticle gets rewritten to mywiki.org/index.php/MyArticle
RewriteRule ^/(.*)$ /index.php/$1 [L,QSA]

Now when I type in mywiki.org/img/logo.jpg in my browser the adress changes to http://wiki.geoknow.eu/Img/logo.jpg (capital I) and I get to the empty article page but the image is definitely there (in my document root under the img folder):

/var/www/mywiki.org$ ls img
logo.jpg

So far so bad. But now it gets really crazy: When I add RewriteCond %{REQUEST_URI} !^/.*\.jpg my adress still gets rewritten and my access log says

- - [05/Dec/2012:16:30:21 +0100] "GET /Img/geoknow_logo.jpg HTTP/1.1" 404 509 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Firefox/17.0"

Where does that capital I in Img come from? The rule is not even executed because at least one condition is definitely not met now and I also don't have any to lowercase-transformation defined anywhere. What is happening there and how can I repair this?

P.S.: Now all of the sudden the problem went away (the image is displayed as it should and there is no capital replacement anymore. What can cause this and why does it spontanously appear and disappear?

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-rewrite