How to force HTTPS connections on your website Print

  • force, https, cpanel, htaccess
  • 0

You can setup a redirection from HTTP to HTTPS adding the following code into your .htaccess file:

RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

The .htaccess file is located inside your public_html folder. You can find this file going into your Cpanel / File Manager / Settings (on the right upper corner) and select "Show Hidden Files (dotfiles)".

Was this answer helpful?

« Back