Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/pull/618'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Sep 18, 2023
2 parents c35ef93 + a2f4460 commit 5ad5bca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cookbooks/foundation/recipes/wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

passwords = data_bag_item("foundation", "passwords")

mediawiki_site "wiki.osmfoundation.org" do
aliases ["www.osmfoundation.org", "osmfoundation.org",
mediawiki_site "osmfoundation.org" do
aliases ["wiki.osmfoundation.org", "www.osmfoundation.org",
"foundation.openstreetmap.org", "foundation.osm.org"]
sitename "OpenStreetMap Foundation"
directory "/srv/wiki.osmfoundation.org"
Expand Down
13 changes: 6 additions & 7 deletions cookbooks/mediawiki/templates/default/apache.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@
RewriteCond %{SERVER_NAME} !=<%= @name %>
RewriteRule ^/(.*)$ https://<%= @name %>/$1 [R=permanent]

RedirectMatch 301 ^/$ /wiki/Main_Page

#Historical Compatibility Links
# Historical Compatibility Links
RedirectMatch 301 ^/index\.php$ /w/index.php
RedirectMatch 301 ^/index\.php/(.*)$ /wiki/$1
RedirectMatch 301 ^/skins/(.*)$ /w/skins/$1
RedirectMatch 301 ^/images/(.*)$ /w/images/$1
RedirectMatch 301 ^/api\.php$ /w/api.php
RedirectMatch 301 ^/opensearch_desc\.php$ /w/opensearch_desc.php

#Support Wikidata redirects based on Wikimedia's redirects:
# Support Wikidata redirects based on Wikimedia's redirects:
# https://github.com/wikimedia/puppet/blob/production/modules/mediawiki/files/apache/sites/wikidata-uris.incl
RedirectMatch 301 ^/entity/statement/([QqPp]\d+).*$ /wiki/Special:EntityData/$1
RedirectMatch 301 ^/value/(.*)$ /wiki/Special:ListDatatypes
Expand All @@ -71,8 +69,9 @@

Alias /wiki <%= @directory %>/w/index.php

#Support /pagename -> /wiki/pagename
# Support /pagename -> /wiki/pagename
RewriteEngine on
RewriteRule ^/$ /w/index.php?title=Main_Page [L,QSA]
RewriteCond %{REQUEST_URI} !^/w/
RewriteCond %{REQUEST_URI} !^/wiki/
RewriteCond %{REQUEST_URI} !^/index\.php
Expand All @@ -83,8 +82,8 @@
RewriteCond %{REQUEST_URI} !^/entity/
RewriteCond %{REQUEST_URI} !^/value/
RewriteCond %{REQUEST_URI} !^/reference/
RewriteCond %{REQUEST_URI} !^/prop/
RewriteCond %{REQUEST_URI} !^/dump/
RewriteCond %{REQUEST_URI} !^/prop/
RewriteCond %{REQUEST_URI} !^/dump/
RewriteCond %{REQUEST_URI} !^/server-status
RewriteCond %{REQUEST_URI} !^/.well-known/
RewriteCond %{LA-U:REQUEST_FILENAME} !-f
Expand Down

0 comments on commit 5ad5bca

Please sign in to comment.