Once your domain has an SSL certificate (included free through AutoSSL), you should send every visitor to the secure https:// address. There are two ways to do it.
First, check the certificate: In cPanel > Security > SSL/TLS Status, your domain and www should show a valid certificate. See How to Get an SSL Certificate Using AutoSSL. Forcing HTTPS without a valid certificate causes browser warnings.
Method 1: The Force HTTPS Redirect Switch (Easiest)
-
Log in to cPanel:
-
Open Domains:
- In the Domains section, click Domains.
-
Turn on the redirect:
- Switch Force HTTPS Redirect to On for the domain. (The switch is only available once the domain has a valid certificate.)
Method 2: .htaccess Rules
Use this if you also want to choose www or non-www, or if your application needs the rule in its own .htaccess file.
-
Open the .htaccess file:
- In Files > File Manager, open your site's folder (usually public_html). If you don't see .htaccess, click Settings and check Show Hidden Files (dotfiles). If there is none, click + File and create one named
.htaccess.
- In Files > File Manager, open your site's folder (usually public_html). If you don't see .htaccess, click Settings and check Show Hidden Files (dotfiles). If there is none, click + File and create one named
-
Add the rules at the very top of the file:
- HTTPS only (keeps whatever host the visitor typed):
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]- HTTPS and always www (replace example.com with your domain):
RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]- HTTPS and never www:
RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301] -
Save and test:
- Click Save Changes and open http://yourdomain.com in a private browser window. It should land on the https address.
WordPress Notes:
- Also set Settings > General > WordPress Address and Site Address to https://. See How to Change the WordPress Address and Site Address.
- If the padlock still shows a warning, see How to Fix a Missing Padlock.
Troubleshooting:
- "Too many redirects": You probably have two redirects fighting (for example, Method 1 plus .htaccess rules plus a plugin), or Cloudflare is set to Flexible SSL. Use one method only, and set Cloudflare to Full (strict).
- Site broke after editing .htaccess: Remove the lines you added and save; the site comes back immediately.
Need help? Open a ticket at https://my.peopleshost.com/submitticket.php and our support team will be glad to assist.