Forum Discussion
Pav_70755
Oct 20, 2010Nimbostratus
HTTP Re-Direct with html holding page
I have a standard HTTP re-direct in place and want to know how I can incorporate a HTML holding page before it re-directs.
Chris_Miller
Oct 20, 2010Altostratus
Give this a shot.
when HTTP_REQUEST {
if { [TCP::local_port] eq "80" } {
persist source_addr 1800
HTTP::fallback http://support.com/
set dtime 3
Un-comment the next 3 lines for redirects and expand out with elseif's if needed
if { [HTTP::host] == "www.domain.co.uk" or "www.domain.com" or "www.domain.org" } {
HTTP::respond 200 content \
"Apology page\
We are sorry, but the site you are looking for is temporarily out of service." "Content-Type" "text/html"
} else {
pool Web_Farm_Front
Un-comment the net line if using redirects
}
} elseif { [TCP::local_port] eq "443" } {
HTTP::header insert "BPL-SSL" "On"
pool Web_Farm_Front
} else {
set srvr [findclass [TCP::local_port] $::Individual_Servers " "]
if { $srvr ne "" } {
node $srvr 80
} else {
Replace HTTP://sitename with the default URL of the site
HTTP::redirect "http://www.domain.net/"
}
}
}
I borrowed logic from the LTM Lite Maint Page.
http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePageLite.html
I haven't tested the above so wouldn't be surprised if it didn't need a tweek or 2.
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