How to redirect HTTP to HTTPS Print

  • 0

Send all insecure traffic to the secure version using .htaccess.

  1. In cPanel File Manager (article 111), open .htaccess in public_html (enable "show hidden files" if needed).
  2. Add these lines at the top:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  3. Save, then test by visiting the http:// version — it should redirect to https://.

Important: Back up .htaccess first. Make sure your SSL certificate is installed (article 140) before adding this, or visitors will hit errors.


War diese Antwort hilfreich?
Back

Powered by WHMCompleteSolution

Chat with us