Other languages / Другие языки / Забонҳои дигар: Русский Тоҷикӣ

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.

Option 1: cPanel toggle

  1. cPanel → Domains
  2. Find your domain in the list
  3. Enable Force HTTPS Redirect

Done. cPanel writes the rule into .htaccess.

Option 2: manually via .htaccess

Open public_html/.htaccess and add at the top:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

For WordPress

Additionally in the admin: Settings → General change "WordPress Address" and "Site Address" from http to https. Otherwise you'll get mixed content.

Verification

  • 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)
這篇文章有幫助嗎? 0 用戶發現這個有用 (0 投票)