You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vitaly <vi...@yahoo.com> on 2007/09/24 09:58:43 UTC

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




       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.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


Re: [users@httpd] How can I limit access only to specific URLs?

Posted by Vitaly <vi...@yahoo.com>.
--- Thomas Antony <th...@antony.eu> wrote:

> 
> >  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)
> > 
> > 
> 
> Hi.
> 
> Use the Location directive in each virtual host
> block.
>
http://httpd.apache.org/docs/2.2/en/mod/core.html#location
> 
> <Location />
> 	Order Deny,Allow
> 	Deny from all
> 	Allow from 192.168.1 192.168.99
> </Location>
> 
> or
> 
> <Location />
> 	Order Allow,Deny
> 	Allow from all
> 	Deny from 192.168.22.5 192.168.33
> </Location>
> 
>
 
Thomas, Thanks for  your answer!
In fact, I want to limit access by URL, not by source
IP/domain. 
Solution with Apache variables, suggested by Thomas,
solved my problem.


       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.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


Re: [users@httpd] How can I limit access only to specific URLs?

Posted by Thomas Antony <th...@antony.eu>.
>  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)
> 
> 

Hi.

Use the Location directive in each virtual host block.
http://httpd.apache.org/docs/2.2/en/mod/core.html#location

<Location />
	Order Deny,Allow
	Deny from all
	Allow from 192.168.1 192.168.99
</Location>

or

<Location />
	Order Allow,Deny
	Allow from all
	Deny from 192.168.22.5 192.168.33
</Location>



Thomas

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