To add https:// automatically on your website, please follow the steps given below.
(This code is not applicable for WordPress)
- First check if your website is working by adding https:// manually in your browser.
- If its working fine with https://, please do the following
- Create (if not already created) a .htaccess file in your public_html folder.
- Add the below given code and replace domain.com with your own domain name.
- RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$RewriteEngine OnRewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
Save this file and now your website should be running with https.
If you are using WordPress, please install Easy HTTPS Redirection plugin and enable it under WordPress Settings.