Forum Discussion
Nandan_01_13367
Nimbostratus
Sep 13, 2013iRule Script request
Hello,
We have a redirect need as explained below. Please let me know if you have an iRule script that can satisfy it.
Redirect
https://bbb.aaa.com/level1/level2/level3.aspx?{dynamical...
nitass
Employee
Sep 15, 2013in case you want to redirect when both http host and path match.
e.g.
[root@ve11a:Active:Changes Pending] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.20.111:443
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
clientssl {
context clientside
}
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 2
}
[root@ve11a:Active:Changes Pending] config tmsh list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "bbb.aaa.com" and [HTTP::path] equals "/level1/level2/level3.aspx" } {
HTTP::redirect "http://www.aaa.org[HTTP::uri]"
}
}
}
[root@ve11a:Active:Changes Pending] config curl -Ik https://bbb.aaa.com/level1/level2/level3.aspx?1234567890
HTTP/1.0 302 Found
Location: http://www.aaa.org/level1/level2/level3.aspx?1234567890
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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