Forum Discussion
Jorge_48257
Nimbostratus
Apr 18, 2011Simple URI iRule Request
Need some quick help on what I believe to be a simple irule. I'm looking to create an irule that does a simple redirect if the requested site has no uri.
For example:
request - https:/...
Colin_Walker_12
Apr 18, 2011Historic F5 Account
So what you're looking for is something like:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] {
"" -
"/" {
HTTP::redirect "https://example.domain.com/example1"
}
}
You could, of course, write this many different ways. You don't need to specifically call out example2 in the URI because the code is only matching empty URIs. /example2 won't be affected.
Colin
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