- In the cPanel File Manager, click Settings.
- Make sure that Show Hidden Files (dotfiles) is checked, and click Save.
- Click on public_html, and open your
.htaccess
if you already have one. If not, click File+, name the file.htaccess
and click Create New File. - Select the
.htaccess
file, and click Edit.- If you just created your
.htaccess
file, use the following code to set up the URL redirect to the HTTPS version of your website:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(www\.)?coolexample\.com RewriteRule ^(.*)$ https://www.coolexample.com/$1 [R,L] - If your
.htaccess
file already exists in your hosting account, do not duplicateReWriteEngine On
. Insert the lines that begin withReWriteCond
andRewriteRule
directly after the already existingReWriteEngine On
.
- If you just created your
- Click Save Changes and Close. That’s it!
Visit your website and you’ll automatically be re-directed to the HTTPS version.
We provide these instructions as a courtesy, but you may need to make other changes to get the redirect working if you already have a .htaccess
file.
More Stories
भारत सरकार की आधार कार्ड के मामले में नयी सलाह जारी
How to Download Any youtube videos Thumbnail
आपके आधार कार्ड से कितने लोगों ने लिया है SIM, इस सरकारी वेबसाइट से करें पता