RE: How can I limit access only to specific URLs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Vitaly [mailto:vitaly_il@xxxxxxxxx] 
> Sent: Monday, September 24, 2007 9:59 AM
> To: users@xxxxxxxxxxxxxxxx
> Subject:  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
Disclaimer: Any disclaimer attached to this message may be ignored. 


> 
> 
>        
> ______________________________________________________________
> ______________________
> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux