Forum Discussion
g3neration_3120
Nimbostratus
Jun 15, 2008Redirecting URI's
Pretty new to iRules, my problem is that I have tried implenting an iRule on a test box. Basically it looks like this:
if { [HTTP:host] equals "test.co.il" and [HTTP::uri] starts_with "/seeme" } {
HTTP::redirect "http://www.test.co.il/test1/test2/seeme/index.htm" }
The redirect will only work if I type in:
test.co.il/seeme/
but not if I type in:
test.co.il/seeme
Any help would be great. Thanks.
- g3neration_3120
Nimbostratus
Actually it works now, probably made a typo somewhere? Not sure where, but it only works if I type in - hoolio
Cirrostratus
You can change equals to ends_with so the redirect is triggered for www.test.co.il and test.co.il.if { [string tolower [HTTP:host]] ends_with "test.co.il" and [HTTP::uri] starts_with "/seeme" } { HTTP::redirect "http://www.test.co.il/test1/test2/seeme/index.htm" }
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