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.
Ru...
Michael_Yates
Mar 20, 2012Nimbostratus
Hi Rusty Tripp,
You can use Wildcards inside of a switch statement to make things fit and act properly as well as set a default action if none of the conditions are met.
I took your original iRule and converted. The "-" at the end of each qualifier tells the iRule that if it qualifies follow the same action as the NEXT item on the list, so in this example all of them will set the HTTP::uri value. If none of them qualify then you will be redirected.
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 }
}
}
Hope this helps.
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