How to force SSL with .htaccess?

How to make a website run with https and not with http ?

To force the HTTPS connection on your website, add the following lines inside the website’s .htaccess file:

 

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
هل كانت المقالة مفيدة ؟ 0 أعضاء وجدوا هذه المقالة مفيدة (0 التصويتات)