Force the use of HTTPS and ensure a secured communication
The use of HTTPS can be forced to ensure all the data transferred between the website and the visitors is encrypted.
Prerequisites
-
Installed SSL Certificate
Completion of the task: 10 minutes
Expertise: intermediate
How to do it?
To force your entire website to go through https, you can add these rules to your .htaccess file. (You can access your .htaccess file with a FTP client or with the File Manager).
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R,L]
If your site is in a subfolder, use this code:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://yourdomain.com/folder/$1 [R,L]
NOTE: Replace yourdomain.com with your domain name and the folder with subfolder in which your site is located and it will work!
0 Comments