After installing SSL the site opens over HTTPS, but the HTTP version is still accessible. Search engines may index both — bad for SEO. You need forced redirect.
\n
Option 1: cPanel toggle
\n
- cPanel → Domains
- Find your domain in the list
- Enable Force HTTPS Redirect
\n
Done. cPanel writes the rule into .htaccess.
\n
Option 2: manually via .htaccess
\n
Open public_html/.htaccess and add at the top:
\n
RewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
\n
For WordPress
\n
Additionally in the admin: Settings → General change “WordPress Address” and “Site Address” from http to https. Otherwise you’ll get mixed content.
\n
Verification
\n
- Open
http://yourdomain.tj— should redirect - Check via
curl -I http://yourdomain.tj— status 301 and Location with https - Check internal links — no http://yourdomain.tj in the code (mixed content)
