Page MenuHomePhabricator

images .htaccess file makes images inaccessible
Closed, ResolvedPublic


This may just be something specific to my local instance, but I can't access anything in my images directory unless I delete the rewrite rules in images/.htaccess.

With the rewrite rules in place, any URL within my images directory results in a 500 server error. With the rewrite rules removed, everything works fine.

I'm using Apache 2.0 in MacOS 10.8.5 with MediaWiki 1.23 (current master).

Version: 1.23.0
Severity: major
See Also:



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:02 AM
bzimport set Reference to bz62289.
bzimport added a subscriber: Unknown Object (MLST).

It isn't only your local instance. I too had problems due to the rules in that damn .htaccess file. I was looking for a solution for over an hour until I finally just randomly checked if there was a hidden file at my images directory, and there it was. I deleted the rules and everything went back to normal. However, I wasn't getting a 500 error, but rather a 403. I'm using Apache 2.2.24, Mac 10.9 and MediaWiki 1.23.1

For reference, the current rewrite rules for images are:

<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]
RewriteRule . - [forbidden]


Ubuntu 14.04.1
Apache 2.4.7-1ubuntu4.1
PHP 5.5.9-1ubuntu4.3

MW 1.24alpha (git master)

The common thing here would seem to be OSX

When I try to access the file directly I get...
You don't have permission to access /images/thumb/... on this server.

The Apache error logs say:
[warn] (2)No such file or directory: Cannot reinit SSLMutex

Looks like an Apache bug. I wonder if any RewriteRule would do it.

Tim: Looks like you're right. I tried a variety of different RewriteConds and they all result in the 500 error.

I'm currently running Apache 2.2.24 (which produces the bug). I'll try upgrading it and see if that makes any difference.

Updated to Apache 2.2.26 and still have the same problem (403 error Forbidden).

Change 176799 had a related patch set uploaded (by Kaldari):
Add FollowSymLinks option to /images .htaccess rule


Change 176799 merged by jenkins-bot:
Add FollowSymLinks option to /images .htaccess rule

kaldari claimed this task.