Forum Discussion
Restrict directory by IP
This first irule IP restriction works for "discard" but the second one does not do the redirect. Any help is appreciated.
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/hello" and ![IP::addr [IP::client_addr] equals 152.140.0.0/16] } { discard } }
This does not work it gets a 404
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/hello" and ![IP::addr [IP::client_addr] equals 152.140.0.0/16] } { HTTP::redirect "; } }
- TayF5unNimbostratus
hi, you should add "; then it works well 🙂
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/haber" and ![IP::addr [IP::client_addr] equals 152.140.0.0/16] } {
log local0. [HTTP::uri]
HTTP::redirect "http://www.google.com"; } }
Recent Discussions
Related Content
* 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