Using .htaccess to force SSL on Apache

Using these rules you can check and then force a secure connection to your site. Add the following lines to your .htaccess file:

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

Your .htaccess file should be in the document root directory / folder. Place the .htaccess file in the same location as your index.html or index.php.

 

Visit sunny St. George, Utah, USA

Get In Touch

We would love to hear from you.

Please enter your email address.
Please enter a valid email address.
Please enter a message.
Please check your message for any errors.
Your message has been sent successfully.
Sorry, an error occured sending your message.
* required