Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

VirtualHost Redirect to HTTPS, SSLRequireSSL? ModRewrite?

Question posted by: dlite922 (Site Addict) on July 3rd, 2008 08:46 PM
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: ( text )
  1. <VirtualHost x.x.x.x:80>
  2.     ServerName sub1.example.com
  3.     DocumentRoot...
  4.     DirectoryIndex...
  5. </VirtualHost>
  6.  
  7. <VirtualHost x.x.x.x:443>
  8.     ServerName sub1.example.com
  9.     SSL Engine on
  10.     SSLCertificateFile ...
  11.     SSLCertificateKeyFile...
  12.     SSLCertificateChainFile...
  13.     DocumentRoot...
  14.     DirectoryIndex...
  15. </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
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Reply
Not the answer you were looking for? Post your question . . .
180,792 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Apache Forum Contributors