Forum Discussion
mike_gatti_6169
Nimbostratus
May 17, 2007Using array/class to define veriable and use for redirect
I have been trying to use an array or class to define a variable that will be used for a redirect. The iRule that I have created (and not working) is:
when RULE_INIT {
array set sites...
mike_gatti_6169
Nimbostratus
May 18, 20071st, thanks much for the help,
I am using the 1st option since the list will be pretty big. In testing the rule I get the following error logged. I tried reading up and playing around with the rule but didn't get very far. This is the error:
TCL error: can't set "sites": variable is array while executing "set sites [ list \ "/site1" \ "/site2" \ ]"
her is the rule as it stands now.
when RULE_INIT {
set sites [ list \
"/site1" \
"/site2" \
]
}
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] starts_with $::sites] } {
HTTP::redirect "http://www.domain.com/global/[string range [HTTP::uri] 1 end]"
}
elseif { [HTTP::uri] starts_with "/global" } {
use pool site_pool
}
}
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