Before completing the steps below make sure you have a valid SSL certificate in place for the domain/website you want to force SSL on.
For example this could be a free Lets Encrypt SSL certificate.
To force SSL connections to a site, you need use either an FTP client such as Filezilla or cPanel File Manager to add or edit the .htaccess file for the folder containing the site.
If you are using cPanel File Manager you will need to ensure that you show hidden files (dotfiles) when opening the File Manager.
Add the following at the top of the .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Clear your browser cache and then navigate to the site to test the new rewrite condition and rule.
When viewing the site, your browser should now automatically load the site over HTTPS.
- 0 Users Found This Useful
Related Articles
Powered by WHMCompleteSolution