Forum Discussion
Reg getfield command in Redirection.
Hi
Is there any difference between the below 2 methods ?.
HTTP::redirect "https://[getfield [HTTP::host] : 1][HTTP::uri]"
HTTP::redirect "https:// [HTTP::host] [HTTP::uri]"
I get the same result when i apply either of them on a Virtual Server listening on Port 80 i.e. http://test7883.com is redirected to https://test7883.com as expected.
Is there any specific advantage of using getfield command in the redirection statement.
Thanks,
Yugandhar.
- Samir_Jha_52506
Noctilucent
getfield is tcl function and more flexible to grepping exact value in long URL/URI String.
getfield: Split a string on a character and returns the string corresponding to the specific field. The field_number parameter is 1 indexed.
getfield
-
HTTP::redirect "https://[getfield [HTTP::host] : 1][HTTP::uri]" --> Here Split String/character is
:
-
HTTP::redirect "https://[HTTP::host][HTTP::uri]" --> Its common redirection conditions.
Rest didn't observe difference.
- Yugandhar
Nimbostratus
Hi F5_Rock,
-
Here getfield functionality is to split the host part i.e. http://test7883.com:8900 ?.
-
what is the use of field_number in the above case it's mentioned as 1 ?.
I am unable to understand why we need to split the host part when we have to do a https redirection for the http request i.e. we wil redirect the http request http://test7883.com:8900 to https://test7883.com:8900
Thanks,
Yugandhar
-
-
- Stanislas_Piro2
Cumulonimbus
as f5_rock explained, getfield command returns a substring of the input string
in your example : the input string is test7883.com:8900
-
[getfield [HTTP::host] : 1] will return test7883.com
-
[getfield [HTTP::host] : 2] will return 8900
-
[getfield [HTTP::host] : 1] will return test7883.com
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