From cfa5be561242b3e724f8141f0d5565b783452dab Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 19 May 2018 10:22:09 +0200 Subject: [PATCH] Can force connection to the website in https --- builder | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/builder b/builder index 5f4e2f4b..dc3f5f86 100755 --- a/builder +++ b/builder @@ -255,6 +255,21 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] '; + +//Check if we have to force https connection +if(defined(get_class($release)."::FORCE_HTTPS")){ + if($release::FORCE_HTTPS){ + + //Inform user + notice("This build will work only with https."); + + //Add rules in .htaccess + $htaccess .= "\n\nRewriteCond %{HTTPS} !on\n"; + $htaccess .= "RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}"; + + } +} + file_put_contents(OUTPUT_DIRECTORY.".htaccess", $htaccess);