- Joined
- Nov 17, 2016
- Messages
- 320
- Points
- 28
Using the following code in your .htaccess file automatically redirects visitors to the HTTPS version of your site:
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.
Forcing SSL via cPanel follow this steps:
- access the redirects section
- set permanent (301) redirect
- choose the domain name
- enter the site's url using the SSL certificate
- make sure wild card redirect is selected
- select redirect with or without www
Forcing SSL via CloudFlare follow this steps:
- Login into your CloudFlare account, choose the domain which you wish to enforce the SSL.
- From there select the Page Rules section and select Create Page Rules.
- Add your URL and select Add a Setting.
- Under Add a Setting select SSL and for SSL Settings choose Full.
Code:
RewriteEngine On
RewriteCond %{HTTPS} off
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.
Forcing SSL via cPanel follow this steps:
- access the redirects section
- set permanent (301) redirect
- choose the domain name
- enter the site's url using the SSL certificate
- make sure wild card redirect is selected
- select redirect with or without www
Forcing SSL via CloudFlare follow this steps:
- Login into your CloudFlare account, choose the domain which you wish to enforce the SSL.
- From there select the Page Rules section and select Create Page Rules.
- Add your URL and select Add a Setting.
- Under Add a Setting select SSL and for SSL Settings choose Full.