Apache SSL redirect

So I have this secure shopping cart RoR project. I want people to simply navigate to the web address but when they get there I want them to automatically be moved over the the SSL version. I was looking for a simply solution one that I could very easily implement without changing much of the code of the site. Here is how I did it.
In Apache Virtual Host file on the *:80 config I have this set.
<VirtualHost *:80>
     ServerName subdomain.domain.com
     Redirect / https://subdomain.domain.com/
     ServerAlias subdomain.domain.com
</VirtualHost>

This will direct any of the information coming in on the port 80 over to the 443/https portion of the website. Make sure you have the HTTP portion configured properly.

Comments

Popular posts from this blog

Console over SSH (ONTAP)

Cacti Monitor Server Step by Step Ubuntu

Brocade Zone Setup