From 5c452385b93437d0ac5641b1bbee97ab2b712886 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Mon, 2 Oct 2017 15:50:37 +0200 Subject: [PATCH] default redirect to https --- .../src/de/hsadmin/mods/dom/DomainProcessorFactory.java | 6 +++--- hsarback/src/de/hsadmin/mods/dom/htaccess.vm | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index 03f56f7..f868870 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -250,16 +250,16 @@ public class DomainProcessorFactory implements EntityProcessorFactory { "chown " + userName + ":" + pacName + " " + domainDir + "/" + subDir )); } - templateVars.put("protocol", "http"); + templateVars.put("www", Boolean.FALSE); domDirsProcessor.appendProcessor( new CreateFileProcessor("/de/hsadmin/mods/dom/htaccess.vm", templateVars, dom, domainDir + "/htdocs/.htaccess", userName, pacName, "644", false) ); - templateVars.put("protocol", "https"); + templateVars.put("www", Boolean.TRUE); domDirsProcessor.appendProcessor( new CreateFileProcessor("/de/hsadmin/mods/dom/htaccess.vm", templateVars, dom, domainDir + "/htdocs-ssl/.htaccess", userName, pacName, "644", false) ); domDirsProcessor.appendProcessor( - new CreateFileProcessor("/de/hsadmin/mods/dom/index.html.vm", templateVars, dom, domainDir + "/subs/www/index.html", userName, pacName, "644", false) + new CreateFileProcessor("/de/hsadmin/mods/dom/htaccess.vm", templateVars, dom, domainDir + "/subs/www/.htaccess", userName, pacName, "644", false) ); domDirsProcessor.appendProcessor( new CreateFileProcessor("/de/hsadmin/mods/dom/index.html.vm", templateVars, dom, domainDir + "/subs-ssl/www/index.html", userName, pacName, "644", false) diff --git a/hsarback/src/de/hsadmin/mods/dom/htaccess.vm b/hsarback/src/de/hsadmin/mods/dom/htaccess.vm index 8473496..7c0da8b 100644 --- a/hsarback/src/de/hsadmin/mods/dom/htaccess.vm +++ b/hsarback/src/de/hsadmin/mods/dom/htaccess.vm @@ -1 +1,5 @@ -Redirect permanent / ${protocol}://www.${dom.name}/ +#if( ${www} ) + Redirect permanent / https://www.${dom.name}/ +#else + Redirect permanent / https://${dom.name}/ +#end