You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by jared <ja...@shift2tech.com> on 2002/08/22 18:14:00 UTC

Virtual Domains

Hello.  I am running a web server with Virtual domains.  (Apache 1.3.26 / Linux i386)

Whenever people try to access domains without the "www." at the beginning, they get thrown to the first virtualdomain listed instead of their website.  The only solution I have thought up so far was to add a virtualdomain listing for every website.  But if you tried to access any of their other domain names, it would do the same.  Is there any way to default to a certain page in by looking at the domain?

TIA  

Re: Virtual Domains

Posted by "Matus \"fantomas\" Uhlar" <uh...@fantomas.sk>.
-> -> Whenever people try to access domains without the "www." at the
-> -> beginning, they get thrown to the first virtualdomain listed instead of
-> -> their website.  The only solution I have thought up so far was to add a
-> -> virtualdomain listing for every website.  But if you tried to access any
-> -> of their other domain names, it would do the same.  Is there any way to
-> -> default to a certain page in by looking at the domain?
-> 
-> That's behaviour of apache - first defined virtual host will access all
-> unknown hosts on given ip/port pair.

-> ServerName _default_ 
-> will pick up all the un-resolved ones

Hmmm this doesn't seem to work by me on apache-1.3.26
I even didn't found this in docs. I found this:

<CITE>
As a consequence, the first listed virtual host is the default virtual host.
[deleted]
If you would like to have a special configuration for requests that do not
match any particular virtual host, simply put that configuration in a
<VirtualHost> container and list it first in the configuration file.
</CITE> 

the case when _default_ has special meaning is, when I use it as
<VirtualHost _default_> - that will match all ips that have no virtualhosts
defined. Or is there something I don't know?

Btw - I'd love such behaviour. But currently it doesn't work for me.

-- 
 Matus "fantomas" Uhlar, uhlar@fantomas.sk ; http://www.fantomas.sk/
 Warning: I don't wish to receive spam to this address.
 Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu.
 - Holmes, what kind of school did you study to be a detective?
 - Elementary, Watson.

---------------------------------------------------------------------
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


RE: Virtual Domains

Posted by Pritpal Dhaliwal <pd...@tycoint.com>.
or the 

ServerName _default_ 
will pick up all the un-resolved ones

Pritpal Dhaliwal


-----Original Message-----
From: Matus "fantomas" Uhlar [mailto:uhlar@fantomas.sk]
Sent: Thursday, August 22, 2002 9:18 AM
To: users@httpd.apache.org
Subject: Re: Virtual Domains


-> Whenever people try to access domains without the "www." at the
-> beginning, they get thrown to the first virtualdomain listed instead of
-> their website.  The only solution I have thought up so far was to add a
-> virtualdomain listing for every website.  But if you tried to access any
-> of their other domain names, it would do the same.  Is there any way to
-> default to a certain page in by looking at the domain?

That's behaviour of apache - first defined virtual host will access all
unknown hosts on given ip/port pair.

You can use ServerAlias directive for all such servers.

-- 
 Matus "fantomas" Uhlar, uhlar@fantomas.sk ; http://www.fantomas.sk/
 Warning: I don't wish to receive spam to this address.
 Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu.
 Support bacteria - they're the only culture some people have. 

---------------------------------------------------------------------
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




Re: Virtual Domains

Posted by "Matus \"fantomas\" Uhlar" <uh...@fantomas.sk>.
-> Whenever people try to access domains without the "www." at the
-> beginning, they get thrown to the first virtualdomain listed instead of
-> their website.  The only solution I have thought up so far was to add a
-> virtualdomain listing for every website.  But if you tried to access any
-> of their other domain names, it would do the same.  Is there any way to
-> default to a certain page in by looking at the domain?

That's behaviour of apache - first defined virtual host will access all
unknown hosts on given ip/port pair.

You can use ServerAlias directive for all such servers.

-- 
 Matus "fantomas" Uhlar, uhlar@fantomas.sk ; http://www.fantomas.sk/
 Warning: I don't wish to receive spam to this address.
 Varovanie: Nezelam si na tuto adresu dostavat akukolvek reklamnu postu.
 Support bacteria - they're the only culture some people have. 

---------------------------------------------------------------------
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


Re: Virtual Domains

Posted by timuel <ti...@voicenet.com>.
You need a ServerAlias directive for each virtualhost.

ie:

ServerName www.somedomain.tld
ServerAlias somedomain.tld.

--
timuel


----- Original Message -----
From: "jared" <ja...@shift2tech.com>
To: <us...@httpd.apache.org>
Sent: Thursday, August 22, 2002 12:14 PM
Subject: Virtual Domains


Hello.  I am running a web server with Virtual domains.  (Apache 1.3.26 / Linux
i386)

Whenever people try to access domains without the "www." at the beginning, they
get thrown to the first virtualdomain listed instead of their website.  The only
solution I have thought up so far was to add a virtualdomain listing for every
website.  But if you tried to access any of their other domain names, it would
do the same.  Is there any way to default to a certain page in by looking at the
domain?

TIA



---------------------------------------------------------------------
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


Re: Virtual Domains

Posted by jared <ja...@shift2tech.com>.
Thanks... I must've missed this earlier.

----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Thursday, August 22, 2002 11:16 AM
Subject: Re: Virtual Domains


> jared wrote:
> > Hello.  I am running a web server with Virtual domains.  (Apache 1.3.26
> > / Linux i386)
> >
> > Whenever people try to access domains without the "www." at the
> > beginning, they get thrown to the first virtualdomain listed instead of
> > their website.  The only solution I have thought up so far was to add a
> > virtualdomain listing for every website.  But if you tried to access any
> > of their other domain names, it would do the same.  Is there any way
> > to default to a certain page in by looking at the domain?
>
> See the ServerAlias directive.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> 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


Re: Virtual Domains

Posted by Joshua Slive <jo...@slive.ca>.
jared wrote:
> Hello.  I am running a web server with Virtual domains.  (Apache 1.3.26 
> / Linux i386)
>  
> Whenever people try to access domains without the "www." at the 
> beginning, they get thrown to the first virtualdomain listed instead of 
> their website.  The only solution I have thought up so far was to add a 
> virtualdomain listing for every website.  But if you tried to access any 
> of their other domain names, it would do the same.  Is there any way 
> to default to a certain page in by looking at the domain?

See the ServerAlias directive.

Joshua.


---------------------------------------------------------------------
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