Forum Discussion
2 Replies
Sort By
- Samir_Jha_52506Noctilucent
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_Piro2Cumulonimbus
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