Basil_Parsley_1
Aug 22, 2016Nimbostratus
Solved
Irule - HTTP redirect with a rewrite.
Guys,
I have a HTTP(S) redirect requirement ; I am migrating Apache load balancer webservices to F5.
The requirement is to redirect
https://webname.com/aaa/Default.aspx?ID:CUST=123 ...
- Aug 22, 2016
Append
to your redirect destination (sample below). The only problem with this approach is that you will always be redirected to a location with ?-symbol at the end, whether you have any query parameters in the original request or not.?[HTTP::query]
HTTP::respond 302 Location "https://webname.com/bbb/default.aspx?[HTTP::query]"
If the above bothers you, you can write a condition to determine if the question mark should be appended or not as follows
Determine if original request contains query parameters if { [HTTP::query] ne "" }{ set myQuery "?[HTTP::query]" } else { set myQuery "" } your condition goes here HTTP::respond 302 Location "https://webname.com/bbb/default.aspx$myQuery"