Forum Discussion
geffryti_32102
Nimbostratus
Feb 24, 2010Help please... my irule fails all the time
Help please! I can't see what's wrong with my iRule, v9 F5 just says that it's failing based on the stats.
when HTTP_REQUEST {
if { $HTTP::uri == "/wi/wpi_jp.jsp" } {
HTTP::redirect "https://abc.com/wi/wpi_jp.jsp"
} elseif { $HTTP::uri == "/sp2" } {
HTTP::redirect "http://abc.com:8086/rtpatch/sp2"
} elseif { $HTTP::uri == "/ub" } {
HTTP::redirect "http://abc.com:8086/rtpatch/ub"
} elseif { $HTTP::uri == "/wpi" } {
HTTP::redirect "http://abc.com:8082/wpi/wpi_jp.jsp"
} elseif { $HTTP::uri == "/IET" } {
HTTP::redirect "http://abc.com:8086/IET"
} else { HTTP::redirect "http://abc.com[HTTP::uri]"
}
}
4 Replies
- naladar_65658
Altostratus
Changed one thing in hoolio's code example, was missing a quote on the first entry:when HTTP_REQUEST { Check the requested URI switch [HTTP::uri] { "/wi/wpi_jp.jsp" { HTTP::redirect "https://abc.com/wi/wpi_jp.jsp" } "/sp2" { HTTP::redirect "http://abc.com:8086/rtpatch/sp2" } "/ub" { HTTP::redirect "http://abc.com:8086/rtpatch/ub" } "/wpi" { HTTP::redirect "http://abc.com:8082/wpi/wpi_jp.jsp" } "/IET" { HTTP::redirect "http://abc.com:8086/IET" } default { HTTP::redirect "http://abc.com[HTTP::uri]" } } } - naladar_65658
Altostratus
Great Tips L4L7!!! - hoolio
Cirrostratus
Thanks for that. You should add yourself to that list :D
That would make a good start to an index page for people who are beginning to work with iRules. You could even include links to the iRule wiki and the tutorials.
Aaron - geffryti_32102
Nimbostratus
Thank you guys!!! great work!
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
