Forum Discussion
ivanchen0503_36
Nimbostratus
Mar 29, 2019iRule how to use rewrite by same token ?
Im not sure about F5 iRule can or not solve this solution , i need rewrite to , only rewrite "iphone.aspx" to "mobile" this key point and the token number need same .. anyone can help this ? thanks .
2 Replies
- Samir_Jha_52506
Noctilucent
Yeah you can do with irule. Try below..
when HTTP_REQUEST { set id [URI::query [HTTP::uri] token] if { [HTTP::uri] starts_with "/iphone.aspx" } { HTTP::redirect "https://www.abc.com/mobile?token=$id" } } - Stanislas_Piro2
Cumulonimbus
Do you want to rewrite or redirect?
For a rewrite:
when HTTP_REQUEST { if { [HTTP::path] equals "/iphone.aspx" } { HTTP::path "/mobile" } }For a redirect
when HTTP_REQUEST { if { [HTTP::path] equals "/iphone.aspx" } { HTTP::redirect [join [list "/mobile" [HTTP::query]] "?" ] } }Join command is there to add question mark only if query string is not empty
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
