Forum Discussion
baboo1970
Altostratus
Nov 03, 2019Irule Datagroup redirect
I have following URLs that need to be redirected using Datagroup and irule but i can't figure out the irule or data set https://www.abc.ca/marrow/Overview > https://test.abc.ca/stashtest ht...
Nov 04, 2019
If you want case sensitivity, datagroup strings sholud be lower case. And you can use this iRule.
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::host][HTTP::uri]] equals test1] } {
set redirect_value [class match -value [string tolower [HTTP::host][HTTP::uri]] equals test1]
HTTP::respond 301 Location "https://$redirect_value"
}
}
You don't need to change datagroup values(redirect_value). They can be contains upper case.
baboo1970
Altostratus
Nov 04, 2019Thanks very much. this worked and now moving onto next challenge as current one is doing exact match in DataGroup but what if requested URL or Destination is not exact match but something starts_with or contains etc... Don't even know where to start with this as i don't know what is actual structure of the HTTP request.
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