- Login to cPanel and go to File Manager.
- On the right side under File Manager, click Settings and check "Show Hidden Files (dotfiles)" and click Save.
- Go to public_html or where your web files are located and look for .htaccess.
Note: If you don't have a .htacess file, you can just add it. To add a file, on the upper left side under File Manager, click "+ File" to add a .htacess and click "create new file". - To add the code to your .htaccess, press right click on your mouse to .htacess file, click Edit and once the loading page is done, click the Edit again.
- Copy and paste the following codes for force SSL(HTTPS) at the top of .htacess if you have an existing code in your .htaccess.
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]
Note 1: If you are using a database in your website, make sure to do "Find and replace" to it from http://yourdomain.com into https://yourdomain.com and if you also declare your domain URL to any parts of your codes.
Note 2: Make sure to replace the word "yourdomain.com" with your real domain name as it is for a sample display only. - Click save and you're done.
- Before accessing your website again, please delete the cache and history to your browser first.
Note: Once it redirects to HTTPS but not showing the green color, make sure to check the "Note 1" in step #5.
- 49 Users Found This Useful