VirtualHost Redirect to HTTPS, SSLRequireSSL? ModRewrite?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    VirtualHost Redirect to HTTPS, SSLRequireSSL? ModRewrite?

    I need help with redirecting virtualhosts to use HTTPS (SSL) when they type in HTTP

    Must work in IE.

    Right now there is two virtual host blocks for every subdomain.

    I want to combine the virtual hosts so that I don't have one for port 80 (which basically gives you a page that says type https, UGH! ugly!), and one for port 443

    Current Config:
    Code:
    <VirtualHost x.x.x.x:80>
    	ServerName sub1.example.com
    	DocumentRoot...
    	DirectoryIndex...
    </VirtualHost> 
    
    <VirtualHost x.x.x.x:443>
    	ServerName sub1.example.com
    	SSL Engine on
    	SSLCertificateFile ...
    	SSLCertificateKeyFile...
    	SSLCertificateChainFile...
    	DocumentRoot...
    	DirectoryIndex...
    </VirtualHost>
    How can I combine those to that if someone types in HTTP it redirects to HTTPS.

    (I know its ModRewrite but I don't know how, GoogleSearch examples were confusing. )

    SSLRequireSSL gives you an access denied page if not SSL?

    thanks in advance,



    Dan
Working...