How to restrict particular URL using Apache ajp Reverse Proxy

apache-2.2mod-proxy-ajpredirectreverse-proxy

I'm using Apache Reverse Proxy, following is some of Apache Virtual Host configuration

ProxyRequests Off
<Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Allow from all
</Proxy>
ProxyVia On
ProxyRequests Off
ProxyPreserveHost On
proxyPass /        ajp://127.0.0.1:8009/

Now I want to restrict request url like http://mysite.com/admin/tools in such a way that
it should allow to access from particular IP address only. How can I achieve this ?

EDIT:

As of above requirement this answer is working fine, Suppose I want allow to access admin URL from one or two IP's and rest IP's I want to redirect to index page instead of showing forbidden error,how can I get this ?

Best Answer

What version of apache are you using? One way to restrict access to resources based on the URL is to use

For example:

<Location /admin/tools>
  Order Deny,Allow
  Deny from all
  Allow from 192.168.1.34
</Location>