mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 04:09:20 +00:00
Can force connection to the website in https
This commit is contained in:
parent
b679b7e651
commit
cfa5be5612
15
builder
15
builder
@ -255,6 +255,21 @@ RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . index.php [L]
|
||||
</IfModule>
|
||||
';
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user