SSL & Security
Enforcing HTTPS Redirection
How to force all HTTP traffic to HTTPS via cPanel or .htaccess.
Enforcing HTTPS Redirection
Method 1: cPanel Toggle (Easiest)
- In cPanel, navigate to Domains > Domains.
- Locate your domain.
- Toggle the Force HTTPS Redirect switch to ON.
Method 2: .htaccess Rewrite Rule
Add the following rule to your public_html/.htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]