Force redirect to HTTPS environment [duplicate]

1

How to force redirect to the HTTPS-based environment with HTACCESS? I need the code to be adapted to what I already have:

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
    
asked by anonymous 04.01.2017 / 14:54

1 answer

2

Try to insert these lines:

RewriteCond %{HTTPS} !=on
RewriteRule ^ HTTPS://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
04.01.2017 / 14:59