Forum Discussion
Deekdeek_103899
Feb 28, 2011Nimbostratus
Newbie mantenance page based on IP address
Hi Im new to F5 world. what i want to do for our maintenance page that redirects all except a certain IP address specified to a site down page. so something like this only IP a...
Chris_Miller
Mar 01, 2011Altostratus
Simple enough, just use the "HTTP::status" command.
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__status.html
Something like this would work. This is simply a different iRule "event" and can be inserted at the end of your current iRule.
when HTTP_RESPONSE {
switch -glob [HTTP::status] {
"403" -
"404" -
"500" { HTTP::redirect "http://www.sample.com/maintenance.html" }
}
}
I've never used HTTP::redirect from the response event and I'm a bit confused that it's usable from there but give it a shot. If it doesn't work, use the rule below instead:
when HTTP_RESPONSE {
switch -glob [HTTP::status] {
"403" -
"404" -
"500" { HTTP::respond 302 Location "http://www.sample.com/maintenance.html" }
}
}
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