Forum Discussion
Dixit_18200
Nimbostratus
Feb 23, 2010Help needed for irule issue
Hi,
I have setup two irules for http to https redirection
1st for redirecting the below websites
http://www.acbg.com/ucc
http://www.acbg.com/saleshu...
hoolio
Cirrostratus
Feb 23, 2010I'd guess this is an issue with trying to send a redirect from both rules on the same request. /var/log/ltm should show a runtime TCl error about multiple redirect invocations. For example, http://www.acbg.com/saleshub/ucc is going to match the first iRule check for a URI ending with /ucc and the second iRule check for /saleshub/ucc.
Hamish's suggestion of using a datagroup and the findclass command is a good one if you don't need to use wildcards. If you do need to use wildcards, you could use a switch statement instead of a datagroup and findclass or the if/elseif/else chain. It would be idea if you could combine the iRules into one to ensure that only one redirect is attempted per HTTP request.
switch -glob [string tolower [HTTP::uri]] {
"*/saleshub/ucc" {
HTTP::redirect "https://microsite.accenture.com/ACBG_SalesHub/solutions/Pages/Outsourcing.aspx"
}
"*/ucc" {
HTTP::redirect "https://microsite.accenture.com/ACBG/Solutions/UCandC/Pages/default.aspx"
}
default {
Take some default action
}
}
No matter what though, you'll need to pick which matches you want take priority for each URI stem (/saleshub/ucc or /ucc, etc).
Aaron
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