I found some information about how to do this on the web, but everything I saw talked about using an .htaccess file. I didn’t want to use an .htaccess file.
Here’s what I had to do in Ubuntu (this was on an old 8.10 server).
Enabled mod_rewrite:
sudo a2enmod rewrite
Add the following in the VirtualHost section of my regular http setup to my config at /etc/apache2/sites-enabled/ :
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} ^/foldername/.\* RewriteRule ^(.\*)$ https://host.name.com$1 [R,L]
Restart Apache:
sudo service apache2 restart
Make sure if you use this to change foldername to the name of the folder where you want to enforce HTTPS and host.name.com to the name of your host.