If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure their information is protected.
To force SSL connections to a site, you need use the cPanel File Manager to add or edit the .htaccess file for the folder containing the site.
You need to ensure that you show hidden files (dotfiles) when opening the File Manager.
Adding the following code at the top of your .htaccess file, automatically redirects visitors to the HTTPS version of your site:
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
If you have an existing .htaccess file:
- Do not duplicate RewriteEngine On.
- Make sure the lines beginning RewriteCond and RewriteRule immediately follow the already-existing RewriteEngine On.
Looking for reliable and affordable web hosting with Dedicated Customer Support?
Get your web hosting today and receive a FREE domain for Life. All plans come with our 30 Day Money Back Guarantee!