Forum Discussion
Allen_Ingram_39
Nimbostratus
Feb 27, 2007Migrating Redirects from CSS with Irule
We are in the process of migrating various redirects to the F5 from our legacy CSS'es. They are about 20 independant redirects pointing to various IP's but all the redirects are a part of www.hsn.com.
I had thought we could change all the redirects to point to the www.hsn.com address and then assign an IRULE to the www.hsn.com Virtual server that sent them to the appropriate redirect within the site.
Would anyone have a script of what the irule would look like? Obviously overall it would be:
If
requested URL has "X" in the field, then go to 1
If
requested URL has "X" in the field, then go to 2
If
requested URL has "Z" in the field, then go to 3
Else
www.hsn.com
- Allen_Ingram_39
Nimbostratus
After reading the forums, I assume I could use a IRULE like: - hoolio
Cirrostratus
If you have more than a couple of cases to check, you could use the switch command:when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { *example.com - *site1.example.net - *site2* { HTTP::redirect "http://host1.example.com" } *site3* - *site4* { HTTP::redirect "http://host2.example.com" } default { HTTP::redirect "http://host3.example.com" } } }
- Marcus_Slawik_8Historic F5 Accounthi jaingram,
- Wes_98712
Nimbostratus
I have read that switch statements are far faster in terms of parsing an execution than regular if/else/then statements.
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