httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garth Winter Webb <ga...@perijove.com>
Subject Re: [users@httpd] domain on ip
Date Sun, 02 Mar 2003 19:39:17 GMT
On Sun, 2003-03-02 at 10:58, Payal Rathod wrote:
> >> http://1.2.3.4/example OR
> >> http://1.2.3.4/~example OR
> >> http://1.2.3.4/example.net
> >> where 1.2.3.4 is the ip where the domain is hosted. There are many more
> >> domains hosted, but I want to allow this facility to this domain only.
> 
> >If you only want it for one vhost, you could just make sure its
> >configuration appears first in httpd.conf - this will make it the default
> >virtualhost, and any unmatched requests will go to it.
> 
> Actually, now I feel I may want it for more than 1 domain.

Putting your configuration in the default virtual host is unnecessary
and doesn't really do what you want.  Besides, the default virtual host
configuration should be for a general case, not a special case.

> >What you've asked for is also quite simple - you need to use the ServerPath
> 
> I read the documentation, but am not sure what exactly to do. Can you give 
> an example, please?

I don't think you want 'ServerPath'.  The 'ServerPath' directive is for
when you have users connecting to your server with old web browsers that
do not send the Host header field, and thus cannot trigger your name
based virtual hosts properly.  You give 'ServerPath' a URL which
uniquely identifies what name based virtual host they were trying to
reach, and Apache does some sort of internal Proxy to serve the page
from the doc root.

It looks like you are doing IP-based virtual hosts anyway:

    http://httpd.apache.org/docs/vhosts/ip-based.html

I think all you want is an Alias.  You just want these requests

    http://1.2.3.4/example
    http://1.2.3.4/~example
    http://1.2.3.4/example.net

to all resolve to:

    http://1.2.3.4/index.html

correct?  If this the case, then:


<VirtualHost 1.2.3.4>
    ...

    Alias /example     /
    Alias /~example    /
    Alias /example.net /
</VirtualHost>


is probably what you want.


-- 
Garth Winter Webb <garth@perijove.com>

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