Forum Discussion
Rusty_Tripp_798
Mar 14, 2012Nimbostratus
iRule not working properly
Hello,
I am using the iRule below but when I enter http://site.name/bd, I don't get redirected to http://site.name/bd/folder/...
Any help would be greatly appreciated.
Rusty
when HTTP_REQUEST { if {(([HTTP::uri] equals "/") or ([HTTP::uri] equals "/levi_b2b/init.do"))} { HTTP::uri "/levi_b2b/init.do" } elseif {[HTTP::uri] equals "/bd*"} { HTTP::uri "/bd/public/frameset_top_html.jsp" } else { HTTP::redirect http://leo.levi.com/index.htm } }
- im not sure you can actually use wildcards in an equals, so in
, what if you try it with contains or starts with?{[HTTP::uri] equals "/bd*"}
- nitassEmployee
e.g.
- Rusty_Tripp_798NimbostratusI've actually tried that way as well but ti didn't work. It seems to me that the iRules is being entered multiple times ( I see this using the LOG command ).
- nitassEmployeecan you try to remove the default case?
when HTTP_REQUEST { switch [string tolower [HTTP::uri]] { "/" { HTTP::uri "/levi_b2b/init.do"} "/levi_b2b" { HTTP::uri "/levi_b2b/init.do"} "/docs" { HTTP::uri "/docs/index.html"} "/bd" { HTTP::uri "/bd/public/frameset_top_html.jsp"} }
- Rusty_Tripp_798NimbostratusIt works. Why is that?
- Rusty_Tripp_798NimbostratusBut I still need the switch to take the default so how do I make this happen if it makes the iRule not work?
- Michael_YatesNimbostratusHi Rusty Tripp,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/" - "/levi_b2b/init.do" - "/bd*" { HTTP::uri "/bd/public/frameset_top_html.jsp" } default { HTTP::redirect http://leo.levi.com/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