Forcing HTTP traffic over HTTPS using Apache
I recently was required to redirect all traffic for a domain over an HTTPS connection. Using the Apache’s .htaccess files and the RewriteEngine, this task is trivial.
Insert this block of code into your .htaccess file at the root of your domain. This will redirect at HTTP traffic to use an HTTPS connection instead:
You also need to make sure you have this line in your httpd.conf file (installed by default on most Linux Distributions)
LoadModule rewrite_module modules/mod_rewrite.so
Recent Comments