Forum Discussion
Irule Datagroup redirect
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.
Thanks 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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