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, and the request URI is supposed to be a secure page, then redirect to a secure page
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*)$1 [R=permanent,L,NC]
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I purchase an SSL Certificate?

At HostHero, customers can purchase an SSL Certificate for their website.  An SSL Certificate...

What is an SSL Certificate?

SSL Certificates enable data encryption on the internet and allow data to be transmitted securely...