Forum Discussion
Brett_11764
Nimbostratus
Nov 15, 2007Redirection Woes
Hi,
I have written an iRule to redirect users based on the requests that they make. The thing I had to watch here was that the redirection was to the same VIP.
What I need:
...
Brett_11764
Nimbostratus
Nov 16, 2007Ok, think I may have found the problem...
A request that excluded the FQDN would be matched twice and therefore redirected twice. I have changed the rule by changing to an elseif and don't seem to have the problem any longer. Will have some load testing done and see what happens!
Also removed some of the local variables...
New rule:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {! ($host contains "domain.com") } {
if {( [HTTP::uri] equals "/" ) } {
if {! ($host contains "was" ) } {
log local0. "FQDN! IRJ! WAS! Redirecting to http://$host.domain.com/irj"
HTTP::redirect "http://$host.domain.com/irj"
} else {
log local0. "FQDN! IRJ! Redirecting to http://$host.domain.com[HTTP::uri]"
HTTP::redirect "http://$host.domain.com[HTTP::uri]"
}
}
}
elseif {( [HTTP::uri] equals "/" ) } {
if {! ($host contains "was" ) } {
log local0. "IRJ! WAS! Redirecting to http://$host/irj"
HTTP::redirect "http://$host/irj"
}
}
}
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
