Forum Discussion
CraigM_17826
Jan 06, 2012Altocumulus
parsing a datagroup/class
Hi all,
I have this situation. Our iRule for our main website now has a lot of redirects which are based on the URI specified. There are now getting to be quite a few of these and for various reasons I won't go into it is getting to be a bit of a pain to maintain these in iRules. I briefy looked at using HTTP Classes and although they addressed some of my issues, for some reason I could not get case insensative matches to work reliably. What I am now thinking of doing is using a datagroup/class where the string name will be the URI to match on and the value will be the URI to redirect to.
eg.
StringName Value
/contactus /public/contact-us
/help /public/help
So the iRule logic would be something like
if the uri equals the value of the first element redirect to 2nd element
Obviously, it would need to repeat this until it exhausts all of the entries in the datagroup.
I feel this will be a much simpler way to manage these redirects. So, can anyone give me any pointers on how I would go about coding this in a iRule? I'm currently going over the class statement and I'll see if I can nut it out for myself, but I am not adverse to any pointers :)
tia
Craig
- CraigM_17826AltocumulusHi Aarron,
- Colin_Walker_12Historic F5 AccountAaron's spot on, Craig, there isn't a simple way to force a data group to be case insensitive when matching items at the moment. We haven't seen much need for this as users are generally content to keep their data group a single case and force the comparisons to be coerced to that case as well. If there is a specific use case that you have and would like to let us know about, we can certainly look into this.
- jmhNimbostratusIt would be nice to simply copy/paste redirect URLs into the datagroup and not have to worry about what case they were submitted in before adding them. Since some web servers care about case sensitivity it would be nice to leave the data as was intended but provide the class command with the ability to ignore case.
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