Topic on Manual talk:Thumb handler.php

Apache .htaccess is not working

2
91.237.27.19 (talkcontribs)

The Apache .htaccess tutorial didn't work for me (Apache 2.4). It gave me a default Apache 404 page. Probably because I have $wgScriptPath = "". Adding Options -MultiViews to .htaccess didn't help. After lots of experimenting I finally made it working like this:

RewriteEngine on
RewriteBase /images
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2 [L,QSA,B]

Maybe this will help someone as well. The key line here is RewriteBase /images.

Ciencia Al Poder (talkcontribs)

No. The key here is to omit the "w/" from the examples. As the line before the examples say:

If your wiki is in the /w directory, something like this should work on apache

Of course, the examples can't account for every possible installation paths, and you should look for possible adaptations

Reply to "Apache .htaccess is not working"