I have a virtual host setup in apache, that works for SSL only. It is setup as so:
SSLProtocol all -SSLv2
RemoveHandler .cgi .pl .py .php4 .pcgi4 .php3 .phtml .pcgi .php5 .pcgi5
RemoveType .cgi .pl .py .php4 .pcgi4 .php3 .phtml .pcgi .php5 .pcgi5
What I want to do, is have it so when someone goes to my site, they are automatically redirected to the https version.
Outside of the VirtualHost, I tried listening on port 80, and redirecting to the secure version, like so
Listen 22.214.171.124:80 NameVirtualHost 126.96.36.199:443
Redirect permanent / https://example.com/
However, this apparantly caused an infinite loop.
What is the correct way to redirect to a https version of a site when the https site is a VirtualHost?