# HG changeset patch # User IBBoard # Date 1490731512 -3600 # Node ID e661cb2dd942ed3fd136d361a551c5bb4654aca5 # Parent 3c978b965881df2a9490d67de642452e2d2e7708 Make sure that we still redirect to non-www if we want it diff -r 3c978b965881 -r e661cb2dd942 modules/website/manifests/https.pp --- a/modules/website/manifests/https.pp Tue Mar 28 20:56:53 2017 +0100 +++ b/modules/website/manifests/https.pp Tue Mar 28 21:05:12 2017 +0100 @@ -29,6 +29,11 @@ $shortname = domain_to_short_name($name) $logpart = $shortname $shortdomain = domain_to_short_domain($name) + if $force_no_www { + $primary_name = $shortdomain + } else { + $primary_name = $name + } $custom_conf0 = template('website/https_core_conf.erb') diff -r 3c978b965881 -r e661cb2dd942 modules/website/templates/https_core_conf.erb --- a/modules/website/templates/https_core_conf.erb Tue Mar 28 20:56:53 2017 +0100 +++ b/modules/website/templates/https_core_conf.erb Tue Mar 28 21:05:12 2017 +0100 @@ -3,5 +3,5 @@ Header always set X-Content-Type-Options "nosniff" Header always set X-Frame-Options "SAMEORIGIN" -RewriteCond %{HTTP_HOST} !=<%= @name %> -RewriteRule ^(.*)$ https://<%= @name %>/$1 [R=301,L] +RewriteCond %{HTTP_HOST} !=<%= @primary_name %> +RewriteRule ^(.*)$ https://<%= @primary_name %>/$1 [R=301,L]