How to Force HTTPS (SSL) on cPanel Hosting
There are several methods to force your website to load via HTTPS in Imageleet cPanel Web hosting Account . Here are the most effective approaches:
Method 1: Using .htaccess (Recommended)
Access your .htaccess file:
Go to cPanel → File Manager
Navigate to your public_html folder
Edit (or create) the.htaccess
file
Add these rules at the top:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ <a href="https://%{HTTP_HOST}%{REQUEST_URI}">https://%{HTTP_HOST}%{REQUEST_URI}</a> [L,R=301]
Method 2: Using cPanel's Built-in Redirects
Go to cPanel →Domains→Redirects
Select Permanent (301) redirect type
Choose your domain from the dropdown
Leave the "redirects to" field empty
Select "https://" from the dropdown
Check "Wild Card Redirect" option
ClickAdd
Method 3: For WordPress Sites
If using WordPress, you can also:
Install the "Really Simple SSL" plugin, or
Add this to wp-config.php:
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL', true);
Or go to Settings → General and change both URLs to https://
Method 4: PHP Force Redirect
Add this to your PHP files (before any output):
if ($_SERVER['HTTPS'] != "on") {
header("Location: <a href="https://" "="">https://"</a> . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit();
}
Verification
After implementing:
Clear your browser cache
Test by visiting your site with http:// (should redirect to https://)
Use SSL checkers like SSL Labs (https://www.ssllabs.com/ssltest/)
Troubleshooting
If you get redirect loops:
Check for multiple redirect rules
Verify your SSL certificate is properly installed
Ensure your site loads properly with https:// forcing redirects
Remember to always back up your .htaccess file before making changes.
Please feel free to contact our support team if you still face problem and we will configure this for you.