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...
Thomas_Schaefer
Nimbostratus
Apr 23, 2009I'm not sure if this is what you are after but I have an Initialize iRule fire first (using priority) to determine if the request is https or not.
when HTTP_REQUEST priority 5 {
log local0. "In Initialize"
if {[TCP::local_port] == 443} {
set ::ghttp_protocol "https\:"
} else {
set ::ghttp_protocol "http\:"
}
}
I then use the ghttp_protocol global in another iRule that does the routing.
HTTP::redirect "$::ghttp_protocol//www.domain.com..."
That allows me to use the inbound port to determine if the connection was secure. granted you need to make sure you only allow SSL on 443, but it works.
Tom Schaefer
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
