Linux

Redirect HTTP traffic to HTTPS with Apache

Posted in Apache, IT, Linux on March 5th, 2009 by David – Be the first to comment

Occasionally when I am setting up a web server I want all interaction to occur in a secure channel encrypted with SSL. I like to leave standard HTTP access available so that the standard http:// url still brings you to the proper site, so I redirect HTTP traffic on port 80 to an HTTPS session on port 443. Since I only do this once in a while, I always have to go searching for the proper method to do it, so I’m posting it here for a quick reference and to share it around.

The way to direct HTTP traffic to HTTPS is with the mod_rewrite URL Rewriting Engine module in Apache. Here is the process that I used earlier today on an Ubuntu 8.04 Server with Apache2. read more »