Forum Discussion
Redirect both host and path via iRules
The nested switch statements seems to be working correctly, as all the conditions are redirecting to the correct https URLs when it's a http request.
However, in my case, I also need to redirect those same conditions when it's a https request. Below is what I have so far:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/example" {
HTTP::redirect "/site1/example"
}
"/example2" {
HTTP::redirect "/site2/example"
}
default {
reject
}
}
}In the above code, I'm having some issues with the default. I've tried using reject and leaving it blank, neither seems to work properly. The default should just go to the main site. How can I accomplish this?
Thanks again for the help
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
