Forum Discussion
Dori_Shmuel_241
Nimbostratus
Jul 13, 2009Block specific URI's
Hello All,
how can i allow access to a specific IP addresses to a specific URI's without blocking any other URI's that i have on my site.
Example:
site.com/abc > allow only to $::abc_allowed
site.com/abcd > allow only to $::abcd_allowed
site.com/abcde > everyone can access
*when someone who is not allowed to access site.com/abc or site.com/abcd, i would like him to see a text that he is not allowed.
I have prepered Irule that is not fully working. I managed to do the access-list but it keeps blocking other URI's that i'm not interest to block
when HTTP_REQUEST
{
if { [HTTP::host] starts_with "site.com" }
{
if {[HTTP::uri] starts_with "/abc" and [matchclass [IP::client_addr] equals $::abc_allowed] }
{
pool site_pool
}
elseif {[HTTP::uri] starts_with "/abcd" and [matchclass [IP::client_addr] equals $::abcd_allowed] }
{
pool site_pool
}
else
{
HTTP::respond 200 content
{
Apology Page
We are sorry, but the site you are looking for does not exist or is not allowed to you.
}
}
}
}
Thanks in advance!
- hoolio
Cirrostratus
If you add logging to the iRule what do you see when a failure occurs?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects