Forum Discussion
Gill_32697
Nimbostratus
Aug 25, 2016using two irules in VS
So we currently have a single large irule on a website. Website will be down for maintenance over the weekend. Need a Sorry maint page redirect for external clients but normal processing for internal...
Hannes_Rapp
Nimbostratus
Aug 25, 2016Add
event disable function to your 1st iRule, after the redirect statement. This will make sure you won't trigger tcl errors of type "multiple redirect/response invocation" when a customer outside 10.0.0.0/8 network requests your website without the preceding 'www.' during maintenance. Any time this tcl error is triggered, a customer will get a "Connection has been reset" error instead of seeing the maintenance page.
Also, rather than using HTTP::redirect, it's better to use HTTP::respond with a Connection=Close header to ensure customer will tear down the existing TCP connection. If a long-lived session prevails, customer may still get the maintenance page upon page refresh even after you have removed the 1st iRule from the VS.
I'd use the following markup myself: ('event disable' function is mandatory, any other amendments are optional recommendations)
priority 499
when HTTP_REQUEST {
if { not ([IP::addr [IP::client_addr] equals 10.0.0.0/8]) } {
HTTP::respond 302 Location "https://www.mysite.com/Portals/0/Documents/Learn/LPCFAQs/mocket.png?ver=2016-06-06-090820-970×tamp=14655037dr5494" Connection Close
event disable
}
}
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