Redirecting HTTP to HTTPS

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Redirecting HTTP to HTTPS

Post 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
xydon1
Forum Newbie
Posts: 3
Joined: Sat Nov 27, 2004 12:55 pm
Contact:

Post 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>
Post Reply