Forum Discussion
Difference between the Irules for redirection:
Hello All, Could you please help me to know is there any functional difference between the following Irules for htpp to https redirection:
HTTP::redirect "https://[HTTP::host][HTTP::uri]"} and HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
1- is there a specific reason to use the option "get field" 2- Is there any functional difference which would in turn would help the redirection performance?
Regards, Thiyagu
- nathe
Cirrocumulus
There's no difference except for the 2nd irule with "getfield" strips off any non standard port, should you have used one in the original http request i.e. http://www.example.com:8080. The redirect will strip off 8080 when changing to HTTPS.
Hope this helps,
N
- jaikumar_f5
Noctilucent
Hope this also give you some extra understanding on the getfield function.
Also you can playaround with the getfield, something like below.
when HTTP_REQUEST { set VIP [getfield [HTTP::host] ":" 1] set a [getfield $VIP "." 1] set b [getfield $VIP "." 2] set c [getfield $VIP "." 3] set d [getfield $VIP "." 4] log local0. "$VIP - IP, $a $b $c $d" }
When the VIP is directly accessed,So on the console this would log something like below, where ":" and "." are the delimiters. Hope this clarifies.
Rule /Common/test-rule : 20.30.40.50 - IP, 20 30 40 50
Recent Discussions
Related Content
* 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