Forum Discussion
Brendan_Hogan_9
Nimbostratus
Sep 10, 2010Error 310 when doing a maintenance redirect
My developer is trying to do a redirect that allows certain ip's to go to an application while all others are directed to an outage page.
* In IE It partially works (but missing part of the application).
*In Firefox I receive an error, “The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”
* In Chrome, I see the following error, "Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects."
Using BIG-IP 10.1.0 Build 3341.48 Engineering Hotfix
Here is the iRule
when HTTP_REQUEST {
set path [HTTP::uri]
set host [string tolower [HTTP::host]]
set bredirect 1
if { [IP::addr [IP::client_addr] equals 105.105.105.81] } {
set bredirect 0
}
elseif { [IP::addr [IP::client_addr] equals 105.105.105.236] } {
set bredirect 0
}
elseif { [IP::addr [IP::client_addr] equals 105.105.105.165] } {
set bredirect 0
}
if { [HTTP::uri] equals "/" }{
set path "/vccs/Main.action"
}
if { $bredirect == 0 } {
HTTP::redirect "https://www.name.org$path"
}
else {
HTTP::redirect "https://outage.name.org"
}
}
Any suggestions???
1 Reply
- hoolio
Cirrostratus
Hi Brendan,when HTTP_REQUEST { set path [HTTP::uri] set host [string tolower [HTTP::host]] set bredirect 1 if { [IP::addr [IP::client_addr] equals 105.105.105.81] } { set bredirect 0 } elseif { [IP::addr [IP::client_addr] equals 105.105.105.236] } { set bredirect 0 } elseif { [IP::addr [IP::client_addr] equals 105.105.105.165] } { set bredirect 0 } if { [HTTP::uri] equals "/" }{ set path "/vccs/Main.action" } if { $bredirect == 0 } { HTTP::redirect "https://www.name.org$path" } else { HTTP::redirect "https://outage.name.org" } }
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