Forum Discussion
sumeemonga_1547
Nimbostratus
Jun 30, 2016i need help in writing the irule for host redirect , uri trim and port redirection
Requirement is like this , that if client calls
Request 1
If URL is https://samplesite.test.com:8443/abc/DEV should be redirected to http://othersamplesite.test.com:9080/abc
Request 2
If ...
sumeemonga_1547
Nimbostratus
Jun 30, 2016hi , this is something is my approach but not sure whether it will work or not , all suggestions invited
when HTTP_REQUEST {
if {[HTTP::host] contains "samplesite.test.com"} {
if {[HTTP::uri] ends_with "/DEV"} {
HTTP::uri [string trimright [HTTP::uri] /DEV]
HTTP::redirect "http://othersamplesite.test.com:9080[HTTP::uri]"
}
if {[HTTP::uri] ends_with "/TST"} {
HTTP::uri [string trimright [HTTP::uri] /TST]
HTTP::redirect "http://othersamplesite.test.com:9080[HTTP::uri]"
} else {
pool default
}
}
}
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