Forum Discussion
vidya_126776
Nimbostratus
Mar 05, 2013issue with irule script ???
This one works fine.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/secure_one" } {
set replaceURI [string map [list /secure /wrap1] [HTTP::uri]]
HTTP::redirect ...
nitass
Employee
Mar 05, 2013just another example.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "www111.abc.com" } {
switch -glob [HTTP::path] {
"/secure_one/*" -
"/ask_wrap/*" -
"/seek_pond/*" {
HTTP::redirect "http://www245.abc.com[string map {/secure_one/ /wrap1/ /ask_wrap/ /wrap1/ /seek_pond/ /wrap1/} [HTTP::uri]]"
}
}
}
}
}
[root@ve10:Active] config curl -I http://www111.abc.com/secure_one/anythinghere/image.gif
HTTP/1.0 302 Found
Location: http://www245.abc.com/wrap1/anythinghere/image.gif
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://www111.abc.com/ask_wrap/anythinghere/anythinghere/image.gif
HTTP/1.0 302 Found
Location: http://www245.abc.com/wrap1/anythinghere/anythinghere/image.gif
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://www111.abc.com/seek_pond/anythinghere/anythinghere/image.gif
HTTP/1.0 302 Found
Location: http://www245.abc.com/wrap1/anythinghere/anythinghere/image.gif
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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