httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Is this a VirtualHost bug? (domain matches subdomains)
Date Thu, 12 Sep 2002 09:54:16 GMT
Just to be clear:

- all your FQDNs resolve to the same IP address?
- do you have a NameVirtualHost directive for this IP?
- is your client using HTTP/1.1 (i.e. sending a "Host:" header)?

As a tip, put the IP address in the VH tag. It is the ServerName which is used for the Host
match, e.g.

<VirtualHost 192.168.1.1:80>
  ServerName domain.co.nz
  ...etc.

Rgds,

Owen Boyle

>-----Original Message-----
>From: Adam Warner [mailto:lists@consulting.net.nz]
>Sent: Donnerstag, 12. September 2002 11:29
>To: users@httpd.apache.org
>Subject: [users@httpd] Is this a VirtualHost bug? (domain matches
>subdomains)
>
>
>Hi all,
>
>I've come across this behaviour and I thought I should check 
>whether it is
>a bug.
>
>With Apache 2.0.40 (from Debian Unstable) VirtualHost configuration, a
>ServerName of the form domain.co.nz will match any subdomain as
>well! (like abc.domain.co.nz). And it will match this entry even if I
>place the non-subdomain entry at the end of the configuration file.
>
>I've worked around this by putting everything into one VirtualHost
>directive. Here's a generic example:
>
>  <VirtualHost domain.co.nz:80>
>    ServerName domain.co.nz
>    RewriteEngine On
>    RewriteLog /var/log/apache2/rewrite.log
>    RewriteLogLevel 0
>
>    RewriteCond %{HTTP_HOST} ^abc.domain.co.nz
>    RewriteRule ^/(.*) http://...
>
>    RewriteCond %{HTTP_HOST} ^def.domain.co.nz
>    RewriteRule ^/(.*) http://...
>
>    RewriteCond %{HTTP_HOST} ^ghi.domain.co.nz
>    RewriteRule ^/(.*) http://...
>
>    #The domain without a subdomain or any other subdomain 
>will match this...
>    RewriteRule ^/(.*) http://...
>  </VirtualHost>
>
>This doesn't appear satisfactory as the ServerName is only correct
>for the last site (the one without a subdomain).
>
>Should a ServerName without any subdomain match all subdomains as is
>happening to me?
>
>Regards,
>Adam
>
>
>
>---------------------------------------------------------------------
>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: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message