httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vitaly <vitaly...@yahoo.com>
Subject RE: [users@httpd] How can I limit access only to specific URLs?
Date Mon, 24 Sep 2007 10:25:06 GMT

--- Boyle Owen <Owen.Boyle@swx.com> wrote:

> > -----Original Message-----
> > From: Vitaly [mailto:vitaly_il@yahoo.com] 
> > Sent: Monday, September 24, 2007 9:59 AM
> > To: users@httpd.apache.org
> > Subject: [users@httpd] How can I limit access only
> to specific URLs? 
> > 
> >  I have a website (virtual server) and many DNS
> > aliases pointed to the same server.
> 
> 
> > 
> > But I have some directory which should be
> accessible
> > only via specific DNS alias (== URL). 
> > If/How this can be done?
> > 
> > E.g, I have a.example.com, b.example.com,
> > c.example.com pointed to the same virtualhost.
> > And for a.example.com I'd like to provide access
> to
> > some dir as http://a.example.com/only_for_a.
> > (it sholdn't be accessible as 
> > http://b.example.com/only_for_a)
> > 
> > 
> 
> Do you mean that the different aliases lead to the
> same website (ie you
> are using many ServerAlias directives in a single
> VH)?
> 
> If so, you could do this using environment
> variables. First, set the env
> depending on the Host name in the request;
> 
> SetEnvIf Host a.example.com allow_host_A
> 
> Second, "Allow" based on whether the env is set;
> 
> <Directory path-to-only-for-A>
>   Order Deny,Allow
>   Deny from all
>   Allow from env=allow_host_A
> </Directory>
> 
> See
>
http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow
> (esp
> environment variables) and
>
http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html#setenvif
> for more
> details.
> 
> 
> 
> Rgds,
> Owen Boyle

Owen, thank you!
It works!
Vitaly


      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7




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