Forum Discussion
kgaigl
Cirrocumulus
Nov 26, 2019IRule change URI only when traffic coming from external
Hello, need some help: I've got the need to rewrite URI from domain.com/internal to domain.com/home but only when traffic comes from outside, not from inside (=private net) the rewrite o...
Nov 26, 2019
Hi kgaigl,
when HTTP_REQUEST {
if { ([HTTP::host] equals "domain.com") and ([string tolower [HTTP::uri]] starts_with "/internal") } {
switch -glob [IP::client_addr] {
"10.*" -
"192.168.*" -
"172.16.*" -
"172.17.*" -
"172.18.*" -
"172.19.*" -
"172.20.*" -
"172.21.*" -
"172.22.*" -
"172.23.*" -
"172.24.*" -
"172.25.*" -
"172.26.*" -
"172.27.*" -
"172.28.*" -
"172.29.*" -
"172.30.*" -
"172.31.*" {
# log local0. "Host: [HTTP::host] Uri: [HTTP::uri] ClientIP: [IP::client_addr]"
}
default {
HTTP::redirect "https://domain.com/home"
# or
# HTTP::uri "/home"
}
}
}
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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