Hi James,
The provided example in K74012450 allows you to block certain URIs for external IPs. Its probable not the right (to complex) solution if you want to block access to a given URI for all clients.
Depending on how the "block" action should be you may use one of the iRule snippets below:
Intercept the Request and send HTTP 403 "Access Denied" response to the User-Agent:
Intercept the Request and send HTTP 403 "Access Denied" response to the User-Agent:
when HTTP_REQUEST {
if { [string tolower "[HTTP::host][HTTP::path]"] starts_with "www100.test.com/ce" } then {
HTTP::respond 403 content "<html><body><h1>Access Denied</h1></body><html>" "Content-Type" "text/html"
}
}
Intercept the Request and redirect the User-Agent to a custom error page or landing URL:
when HTTP_REQUEST {
if { [string tolower "[HTTP::host][HTTP::path]"] starts_with "www100.test.com/ce" } then {
HTTP::respond 302 "Location" "/error_page.html"
}
}
If the block list gets more complex (e.g. more entries) you may need a different technique to filter URLs. Also keep in mind that the block list in my examples are filtering request to "www100.test.com/ce*". If your web application is also accesible via lets say "https://212.212.212.212/ce" then the filtering wont work. You may need to skip checking of the HOST-Name to make the black-listing more robust...
Cheers, Kai