> I must be missing something - correct me if I'm wrong, but...
>
> > NameVirtualHost 111.22.33.44
> >
> > <VirtualHost 111.22.33.44:80>
> >  ServerName name1.mydom.com
> >  DocumentRoot /home/webfoot/public_html
> > </VirtualHost>
> > <VirtualHost 111.22.33.44:80>
> >  ServerName namessl.mydom.com
> >  DocumentRoot /home/webfoot/secure_html
> > </VirtualHost>
>
> Won't the above pair of vhost entries result in the following?
>
>      URL entered:                         file served:
> ------------------------      ------------------------------------
> http://namessl.mydom.com ---> /home/webfoot/secure_html/index.html
>
> As it is now, this URL causes /home/webfoot/public_html/index.html to
> be served. But, this is a better situation than serving the files from
> secure_html via an unencrypted link. What I want is to serve nothing
> (except an error message).
>
> Sorry if I'm being dense.

Oh, I thought you just wanted the appropriate servername to serve the right
files.

How about redirecting from the wrong vhost to the right one like this?

<VirtualHost 111.22.33.44:80>
 ServerName name1.mydom.com
 DocumentRoot /home/webfoot/public_html
</VirtualHost>
<VirtualHost 111.22.33.44:80>
 ServerName namessl.mydom.com
 Redirect / https://namessl.mydom.com
</VirtualHost>

<VirtualHost 111.22.33.44:443>
 ServerName namessl.mydom.com
 DocumentRoot /home/webfoot/secure_html
</VirtualHost>
<VirtualHost 111.22.33.44:443>
 ServerName name1.mydom.com
 # You man want to change this to redirect to
 # http://name1.mydom.com But know that a certificate
 # warning will appear before the redirection (I think)
 Redirect / https://namessl.mydom.com
</VirtualHost>

-Dave

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to