Forum Discussion
Adil_Khan_31203
Cirrus
Aug 15, 2018Redirect iRule
Hi all,
I am trying to set an iRule to redirect HTTP request to a different URL.
Basically for testing purpose, I created a WideIP which resolves to a WebServer which displays a Blue Page.
I ad...
Samir_Jha_52506
Noctilucent
Aug 15, 2018Try below iRule.
when HTTP_REQUEST {
if { [HTTP::host] contains "testblue" }
{ HTTP::redirect "https://open/open" }
}
- Adil_Khan_31203Aug 15, 2018
Cirrus
Hi there,
This didnt work unfortunately
- Samir_Jha_52506Aug 15, 2018
Noctilucent
Try switch statement to match wildcard.
when HTTP_REQUEST { switch -glob -- [HTTP::host] { "*testblue*" { HTTP::redirect "https://open/open" } default { reject } } }
- Adil_Khan_31203Aug 15, 2018
Cirrus
I have the same error, look more like a bug than issue with the iRule itself
- Samir_Jha_52506Aug 15, 2018
Noctilucent
Executive same irule on other F5 device to check if any device specific issue.
- Adil_Khan_31203Aug 15, 2018
Cirrus
Tried on the Virtual F5 with a Lab licence running 11.6.1 Same issue
- Adil_Khan_31203Aug 15, 2018
Cirrus
I tested this on LTM and the iRule saved without any issue. But GTM/DNS still gives issues.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects