changeset 338:7e3c977e970a

Swap to a Redirect-based canonical hostname Recommended on https://httpd.apache.org/docs/2.4/rewrite/remapping.html
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 May 2020 14:46:59 +0100
parents a79ad974a548
children c90dc847246b
files modules/website/templates/https_core_conf.erb
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/website/templates/https_core_conf.erb	Sat May 16 14:05:09 2020 +0100
+++ b/modules/website/templates/https_core_conf.erb	Sat May 16 14:46:59 2020 +0100
@@ -9,5 +9,6 @@
 Header always set X-Content-Type-Options "nosniff"
 Header always set X-Frame-Options "SAMEORIGIN"
 
-RewriteCond %{HTTP_HOST} !=<%= @primary_name %>
-RewriteRule ^(.*)$ https://<%= @primary_name %>$1 [R=301,L]
+<If "%{HTTP_HOST} != '<%= @primary_name %>'">
+	Redirect permanent "/" "https://<%= @primary_name %>"
+</If>