Forum Discussion
Samir_Jha_52506
Noctilucent
You could use getfield function to grep host name.
iRule will be some thing like below. Paste the comments if any help require.
when HTTP_REQUEST {
if { [HTTP::host] contains "test.com"} {
HTTP::respond 301 Location "https://[getfield [HTTP::host] ".test.com" 1].result.com[HTTP::uri]
}
}
Cheers...
Thiyagu_343098
May 29, 2018Nimbostratus
Hello All, I have tried the below script and it is throwing the error while saving the irule. Could you please help me to know anything syntax I have to change with the below script?
when HTTP_REQUEST { if { [HTTP::host] contains "test.com"} { HTTP::respond 301 Location "https://[getfield [HTTP::host] ".test.com" 1].result.com[HTTP::uri] } }
Your quick help would be appreciable.
Regards, Thiyagu