After installing SSL, you should redirect all HTTP traffic to HTTPS. This ensures visitors always use the secure version of your site.
Why Force HTTPS?
- Visitors typing your domain without https:// get redirected automatically
- Old bookmarks and links still work
- Search engines see one canonical version (better for SEO)
- Prevents accidental unencrypted access
Method 1: .htaccess (Apache/LiteSpeed)
Add this code to the top of your .htaccess file in your web root:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Also Redirect www to non-www (or vice versa)
# Force HTTPS and non-www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301]
Method 2: cPanel Redirects
- Log into cPanel
- Go to Domains ? Redirects
- Select your domain
- Set redirect from http:// to https://
- Choose Permanent (301)
- Click Add
Method 3: WordPress Settings
- Go to Settings ? General
- Change WordPress Address (URL) to https://
- Change Site Address (URL) to https://
- Save
Then add the .htaccess redirect above.
Method 4: WordPress Plugin
Install Really Simple SSL plugin:
- Install and activate the plugin
- Click "Go ahead, activate SSL!"
- The plugin handles redirects and mixed content
Verify Your Redirect
Test that redirects work correctly:
- Visit http://yourdomain.com — should redirect to https://
- Visit http://www.yourdomain.com — should redirect to https://
- Check with curl:
curl -I http://yourdomain.com - Look for "301 Moved Permanently" and "Location: https://..."
Common Issues
- Redirect loop: Your server may already be handling SSL. Remove duplicate redirect rules.
- Mixed content after redirect: Update internal links to use https://
- Cloudflare issues: Set SSL mode to "Full" or "Full (Strict)" in Cloudflare
Important: Use 301 (permanent) redirects, not 302 (temporary). This tells search engines to update their index.