]> git.openstreetmap.org Git - chef.git/commitdiff
civicrm: fix redirect to keep url
authorGrant Slater <github@firefishy.com>
Fri, 11 Aug 2023 17:51:06 +0000 (18:51 +0100)
committerGrant Slater <github@firefishy.com>
Fri, 11 Aug 2023 17:51:06 +0000 (18:51 +0100)
cookbooks/civicrm/recipes/default.rb
cookbooks/civicrm/templates/default/apache.erb

index 16947c9efd7aeab677c620d564e57a30da77b5b8..f21f5fc6da2ea4aeb2174b07a6ce3b9faf9a38e1 100644 (file)
@@ -29,6 +29,8 @@ package %w[
   php-intl
 ]
 
+apache_module "rewrite"
+
 cache_dir = Chef::Config[:file_cache_path]
 
 passwords = data_bag_item("civicrm", "passwords")
index dd6112f121916cb7ebe5441c15e2c69c1fd6a85a..727b0b9132c56d1c988c89e5582ef0b73e698dee 100644 (file)
 
   ServerAdmin webmaster@openstreetmap.org
 
+  RewriteEngine on
+
 <% if port == 80 -%>
-  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
-  RedirectPermanent / https://supporting.openstreetmap.org/
+  RewriteRule ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 [R=permanent,L]
 <% end -%>
 <% if port == 443 -%>
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/join.osmfoundation.org.pem
   SSLCertificateKeyFile /etc/ssl/private/join.osmfoundation.org.key
+<% end -%>
 
-  RedirectMatch . https://supporting.openstreetmap.org/
-  <% end -%>
+  RewriteRule ^/(.*)$ https://supporting.openstreetmap.org/$1 [R=permanent,L]
 
   CustomLog /var/log/apache2/join.osmfoundation.org-access.log combined
   ErrorLog /var/log/apache2/join.osmfoundation.org-error.log