Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223477

Change subject: Fix thumb rewrite rules
......................................................................

Fix thumb rewrite rules

Since 2.3, Apache might or might not resolve REQUEST_FILENAME to an actual
filesystem path (as opposed to an URI), depending on the context.
Putting the rewrite rules in a Location block ensures that the resolution
does happen.

Bug: T56202
Change-Id: Ia89058f2abdd925a1c6145108d21e1cb02faf989
---
M puppet/modules/role/templates/thumb_on_404/apache2.conf.erb
1 file changed, 11 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/77/223477/1

diff --git a/puppet/modules/role/templates/thumb_on_404/apache2.conf.erb 
b/puppet/modules/role/templates/thumb_on_404/apache2.conf.erb
index 5989d90..b34b4ed 100644
--- a/puppet/modules/role/templates/thumb_on_404/apache2.conf.erb
+++ b/puppet/modules/role/templates/thumb_on_404/apache2.conf.erb
@@ -1,13 +1,15 @@
 RewriteEngine On
 
-# call thumb.php for thumb images not on disk
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^<%= @images_path 
%>/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/[^/]*([0-9]+)px-.*$ 
/w/thumb_handler.php [PT,QSA,B]
+# needs to be in a location block otherwise apache would not apply aliases 
before testing the RewriteCond
+<Location <%= @images_path %>>
+  # call thumb.php for thumb images not on disk
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteRule ^<%= @images_path 
%>/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/[^/]*([0-9]+)px-.*$ 
/w/thumb_handler.php [PT,QSA,B]
 
-
-# call thumb.php for thumb archive images not on disk
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^<%= @images_path 
%>/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/[^/]*([0-9]+)px-.*$ 
/w/thumb_handler.php [PT,QSA,B]
+  # call thumb.php for thumb archive images not on disk
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteRule ^<%= @images_path 
%>/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/[^/]*([0-9]+)px-.*$ 
/w/thumb_handler.php [PT,QSA,B]
+</Location>
 

-- 
To view, visit https://gerrit.wikimedia.org/r/223477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia89058f2abdd925a1c6145108d21e1cb02faf989
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to