The requests will actually be processed by the rules of the correct named 
virtual host (according to the host header); the only problem is that the 
certificate the server will use for authenticating to the client is the one 
defined in the first of the virtual hosts. At the time of SSL session 
establishment, the HTTP request has not yet been transmitted to the server, so 
the server cannot possibly know the value of the Host header.

-ascs

-----Original Message-----
From: Krist van Besien [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 04, 2006 10:41 AM
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] Redirect Problem

On 5/3/06, Stuart, Ed <[EMAIL PROTECTED]> wrote:
>
>
> We're running Apache 2.0.46 on Red Hat kernel 2.4.  We're trying to 
> shorten the URL our clients have to use to connect to an application.  
> We have three environments; development, test, and production. Our 
> approach is to create a DNS entry in the format of 
> environment.appname.domain and have it resolve to 
> environment.webserver.domain and when they arrive look at what application 
> they are seeking and redirect them to environment.webserver.domain/appname.
> We've got this working with the DNS as described and the following 
> entry in the httpd.conf file.
>
> <VirtualHost *>
> ServerName test.appname.domain
> ServerAlias *
> Redirect permanent / https://testweb.domain/appname </VirtualHost>
>
> Our problem is that if clients mistakenly enter 
> https://test.appname.domain instead of http://test.appname.domain they 
> are directed to the default page of https://testweb.domain which is the 
> index.html file.
>
> How can we fix this, and is there a better way to solve the original 
> problem?

(repost, aparently some keypresses are interpreted by gmail as hotkey and 
caused a prematures send)

Probably https requests are not processed by te virtual server you described 
above. Have a look at the ssl config. Also it is not possible to have 
namevirtual hosts under ssl, so all ssl requests will go to the same virtual 
host (probably the first)

a command that might give you some hints as to what gets processed by which 
part of the config is:
httpd -S -DSSL

You could do what you are trying above with a rewrite. This would save you 
having to add virtual hosts for every app.

For example:

RewriteCond         %{HTTP_HOST}           ^(dev|test|prod)\.(.*)\.domain$
RewriteRule          (.*)                             
https://%1web.domain/%2/$1 [R,L]

(Disclaimer: This is of the top of my head, I haven't tested it.)

Krist






--
[EMAIL PROTECTED]
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to