Forum Discussion
Mia_27938
Nimbostratus
Mar 13, 2014The question about the rewriting URI based on source IP
Hi all,
I Have a Standard VS with a http profile and the service domain is "http://www.abc.com"
I want to rewriting or replacing the URI based on source IP.
For example,
When the request...
Mar 13, 2014
If you have any objects, like images or css, in the different subfolders, ie /test1/img/picture.gif, /test2/script.js you might want to try this one:
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { [IP::addr [IP::client_addr] equals 10.10.10.0/24] } {
Do nothing to forward to the default pool
} elseif { [IP::addr [IP::client_addr] equals 20.20.20.0/24] } {
if { not $uri starts_with "/test1" } {
HTTP::uri "/test1"
}
} else {
if { not $uri starts_with "/test2" } {
HTTP::uri "/test2"
}
}
}
Please note that all these uses the default pool, but with different URI's.
/Patrik
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