Forum Discussion
Gill_32697
Nimbostratus
Feb 10, 2014uri redirects
So i need to redirect to website based on a uri. I have about 100 redirect and I my need to add, remove or edit from time to time. Below is what I have but is giving me an error when I save in editor...
Kevin_Stewart
Employee
Feb 10, 2014Notice that I'm doing a [string tolower ] comparison. Your data group strings should then all be lowercase (ex. /bob, /sue, /fred, etc.). I modified the iRule a little to use a "starts_with" conditional instead of "equals".
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with my_uri_dg] } {
HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with my_uri_dg]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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