]> git.openstreetmap.org Git - chef.git/commitdiff
Redirect mediawiki requests to the primary site name
authorTom Hughes <tom@compton.nu>
Sun, 19 Apr 2015 16:49:06 +0000 (17:49 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 19 Apr 2015 16:58:54 +0000 (17:58 +0100)
cookbooks/mediawiki/templates/default/apache.erb

index 0bedf21248d758bc8932c006c47e3761c42cf7e9..7aed4b3e71139acc3780a2ae9b0159baf700e835 100644 (file)
   php_value upload_max_filesize 70M
   php_value post_max_size 100M
 
+  RewriteCond %{SERVER_NAME} !=<%= @name %>
+<% if port == 443 -%>
+  RewriteRule ^/(.*)$ https://<%= @name %>/$1 [R=permanent]
+<% else -%>
+  RewriteRule ^/(.*)$ http://<%= @name %>/$1 [R=permanent]
+<% end -%>
+
   RedirectMatch 301 ^/$                           /wiki/Main_Page
 
   #Historical Compatibility Links