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_MillerAltostratusGive 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/" } } }
- Pav_70755NimbostratusHi Chris,
Un-comment the following lines if the site uses SSL when CLIENT_ACCEPTED { TCP::collect 5 } when CLIENT_DATA { if { [matchclass [TCP::payload] starts_with $::http_methods] } { SSL::disable } } 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::uri] ends_with "/default.asp?File=pressdetail&id=87" } { HTTP::respond 200 content \ "JAN We've Moved! Temp holding page Temp You will automatically be redirected in 5 seconds. Alternatively, you can visit Temp now © Temp & , Inc. " } 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/" } } }
- hooleylistCirrostratus...
- hooleylistCirrostratusHi Pav,
when CLIENT_ACCEPTED { Start of HTML Save the HTML here with support for variables set html [subst -nocommands { JAN We've Moved! Temp holding page Temp You will automatically be redirected in 5 seconds. Alternatively, you can visit Temp now © Temp & , Inc. }] End of HTML } Un-comment the following lines if the site uses SSL when CLIENT_ACCEPTED priority 501 { TCP::collect 5 } when CLIENT_DATA { if { [matchclass [TCP::payload] starts_with $::http_methods] } { SSL::disable } } when HTTP_REQUEST { if { [TCP::local_port] == 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::uri] ends_with "/default.asp?File=pressdetail&id=87" } { HTTP::respond 200 content $html } else { pool Web_Farm_Front Un-comment the net line if using redirects } } elseif { [TCP::local_port] == "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/" } } }
- Colin_Walker_12Historic F5 AccountYou won't be able to suck in an outside page, no. You'll need to put the HTML in either the iRule directly or you can put it into a data group, but that takes a little more massaging.
- Pav_70755NimbostratusThanks Hollio that worked,
- Pav_70755NimbostratusAlso for some reason these re-directs dont seem to work in IE9 but work perfectly in firefox? are there any IE specific tags or entries that need to be made?
- Pav_70755NimbostratusOK i've realised that this is because I have changed the HTTP::respond 200 to HTTP::respond 301 is there any workaround for this?
- fLyf5_21542NimbostratusFirst hit on the VS is on port 80 and team here doesnt want the request reaching webserver, the default page which they shared contain images, please advice on how to store these images locally and to display the page properly.
- fLyf5_21542NimbostratusHi Pav
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