Forum Discussion
PeterC_70986
Nimbostratus
Mar 01, 2019irule redirect based on URI does not work if there are numbers in it
I have an irule that is redirecting based on the URI. If one of the levels in the path is all numbers, the redirect does not work. If I shorten the URI and remove the numbers, the redirect works. ...
Michael_Saleem1
Cirrus
Mar 01, 2019Which TMOS version are you on?
I just tested that iRule out in my home lab and it was working fine
iRule
root@(localhost)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm rule REDIRECT
ltm rule REDIRECT {
when HTTP_REQUEST {
if { [HTTP::uri] contains "whatever/12345/something" } {
HTTP::redirect "https://www.abc.com[HTTP::uri]" }
}
}
cURL Verification
$ curl -IL http://192.168.1.100/whatever/12345/something
HTTP/1.0 302 Moved Temporarily
Location: https://www.abc.com/whatever/12345/something
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
