Forum Discussion

brightstar_uk_2's avatar
brightstar_uk_2
Icon for Nimbostratus rankNimbostratus
Jun 19, 2015

https irule redirect

hi,

 

i'm new to F5 so hopefully this is a quick one.

 

currently I have a 443 irule setup as follows:

 

when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "qv-emea.brightstar.com" { if { [HTTP::host] contains "qv-emea.brightstar.com" } { pool Pool_qv-emea_4401 return } else { reject } }

 

I have an issue where you hit the url and it's redirecting to the IP and not site name. if I add a / at the end of the url it works ok.

 

therefore, how do I amend the above to re-direct from https://xxxxx.com/qlikview to https://xxxxx.com/qlikview/ ? I was thinking I need another IF statement to say { if { [HTTP::uri] start_with "/qlikview" } { HTTP::redirect "https://xxxxx.com/qlikview/?[URI::query [HTTP::uri]]" } }

 

also, assuming I have to re-write the host header to get it from ip to site name? if so, can anyone please assist me in getting the irule to do all the above?

 

any assistance would be really appreciate

 

thanks in advance,

 

2 Replies

  • Your iRule is a bit ambiguous. Why are you checking/comparing the host twice (switch + if)? What is your exact requirement? Do you just need to redirect HTTP traffic to HTTPS?

     

    Thanks DJ

     

  • Hi, thanks for the response. you're correct in your assumption I firstly want to direct from http to https. then we're having an issue that hitting https://qv-emea.brightstar.com/qlikview you will see somehow ISS redirects to the internal IP, and with the slash at the end IIS redirects correctly.