From f5defa100e11f1449a63e88f822187293493be5f Mon Sep 17 00:00:00 2001 From: Ryan Lane Date: Mon, 21 Jan 2013 10:49:36 -0800 Subject: [PATCH] Fix images url and add redirects for wiki Images location from a url perspective is /w/images, not /images. Also, add redirect from /article to /wiki/article. Change-Id: I63f29a5c3e66e3a3e9c0dc53ac8deb9550390912 Reviewed-on: https://review.openstack.org/20167 Reviewed-by: Jeremy Stanley Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins --- modules/mediawiki/templates/apache/mediawiki.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/mediawiki/templates/apache/mediawiki.erb b/modules/mediawiki/templates/apache/mediawiki.erb index f89fb71738..82d9758512 100644 --- a/modules/mediawiki/templates/apache/mediawiki.erb +++ b/modules/mediawiki/templates/apache/mediawiki.erb @@ -58,7 +58,7 @@ Order allow,deny allow from all - /images"> + "> # Ignore .htaccess files AllowOverride None @@ -96,7 +96,13 @@ Alias /w <%= scope.lookupvar('mediawiki::mediawiki_location') %> Alias /wiki <%= scope.lookupvar('mediawiki::mediawiki_location') %>/index.php - Alias /images <%= scope.lookupvar('mediawiki::mediawiki_images_location') %> + Alias /w/images <%= scope.lookupvar('mediawiki::mediawiki_images_location') %> + + # Redirect old /Article_Name urls + RewriteEngine on + RewriteCond %{REQUEST_URI} !^/w/ + RewriteCond %{REQUEST_URI} !^/wiki/ + RewriteRule ^/(.*)$ https://<%= scope.lookupvar("mediawiki::site_hostname") %>/wiki/$1 [L,R] ErrorLog /var/log/apache2/error.log