Forum Discussion
Jayant_134932
Nimbostratus
Mar 24, 2016How to append part of URI to redirected url in an iRule?
We recently moved from OHS to WLS for a runtime Apex environment. I am trying to setup a http::redirect rule. When a user types url "/pls/apex/f:p=1:1", it should be redirected to "/apex/f:p=1:1". I have tried http:uri, but it doesn't work. Is it possible to take part of the URI "/f:p=1:1" and append it to the redirected url?
1 Reply
- tatmotiv
Cirrostratus
If the first part of the path ("/pls") is always the same and always needs to be removed, you could try something like that in order to cut off the first 4 characters:
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/pls/" } { newuri=[string range [HTTP::uri] 4 end] HTTP::redirect http://[getfield [HTTP::host] ":" 1]$newuri } }
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