Forum Discussion
raytoles_75680
Nimbostratus
Jan 13, 2010Several redirects in one iRule
I want to through this out there to see if any of the experts see any problems with this irule. We have some pretty specific redirects I want to place in a single iRule. Below is a sample of where I...
hoolio
Cirrostratus
Jan 13, 2010Hi Ray,
You're doing a check on the host header value and the URI. But then you're doing a separate check of the URI with the switch statement. A URI couldn't match /newbooks/newresources and any of the specific switch cases so everything which matches the first check for /newbooks/newresources would hit the default switch case.
If you're not using wildcards in the switch cases, you could remove the -glob flag from the switch statement.
Also, I assume the author names are not literally author[1-x]? If they're unique names and you only want to redirect specific names to new author-specific locations, I'm not sure there is a way to trim down the number of switch cases. If the names were part of a general pattern, you might be able to replace the non-default switch cases with one case. Can you provide a few sample original URIs you want to redirect and their corresponding redirect locations using more exact names?
Aaron
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