Just more ramblings of another IT Guy

Force complete website to HTTPS

`

The below can be added to the httpd.conf file for best performance as the whole site is being redirected to https (can also be added to a .htaccess file). The result is that when a client connects to the server via http they are redirect to a https connection.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

This entry was posted in Handy Linux Commands, Tips+Tricks. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *