Page 1 of 1

Redirecting HTTP to HTTPS

Posted: Wed Nov 24, 2004 5:39 pm
by myleow
Can anyone give me information as to how to setup Apache to reroute all request to HTTP to HTTPS?

I set up Apache+Mod SSL and currently i can get to both port 80 and 443, so i was wondering how do i reroute all request from 80 to 443.

Thank you in advance,

Regards
Mian

Posted: Sat Nov 27, 2004 1:19 pm
by xydon1
This is what I use in my httpd.conf:

<VirtualHost 10.100.176.42:80>
ServerName lists2.fws.gov
Redirect / https://lists2.fws.gov/cgi-bin/lsg2.cgi
</VirtualHost>

<VirtualHost 10.100.176.42:443>
ServerName lists2.fws.gov
DocumentRoot /home/ecartis/scripts

<Location />
Options Indexes FollowSymLinks +ExecCGI
Allow from all
AllowOverride None
Order allow,deny
SetHandler cgi-script
DirectoryIndex /usr/local/apache/cgi-bin/lsg2.cgi
</Location>

SSLEngine On
SSLCertificateFile /usr/local/certs/lists.fws.gov.crt
SSLCertificateKeyFile /usr/local/certs/lists.fws.gov.key

</VirtualHost>