1. Home
  2. SSL Certificates
  3. Redirect to SSL with .htaccess

Redirect to SSL with .htaccess

Once you have purchased an SSL certificate for your website you can redirect your site to connect to the https version by creating a .htaccess file and placing it in your public_html folder.

In the .htaccess file add the following and replace the domain with your actual domain name:

#If the page is NOT secure, redirect to a secure page
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.domain.com/$1 [R=permanent,L,NC]
Updated on September 26, 2019

Was this article helpful?

Related Articles