Forum Discussion
Gary_Penn_10498
Nimbostratus
May 25, 2006Redirecting during a certain time frame
We need to put one of our websites into a 'maintenance' splash page and would like to automate the process as it will happen in the middle of the night. I've written an iRule that will redirect reque...
Gary_Penn_10498
Nimbostratus
May 25, 2006That was perfect, thanks. Here's my final rule for the record. Anybody who wants to redirect (most likely overnight as it is here) at a certain time for external IP's should find this useful:
when HTTP_REQUEST {
set current_day [clock format [clock seconds] -format {%a} ]
set current_time [clock seconds]
set time_min [clock scan {21:00}]
set time_max [clock scan {04:00}]
if { [IP::remote_addr] contains "172" }
{
HTTP::redirect https://internalsite.com
}
elseif { (($current_day == {Mon}) and ($current_time > $time_min)) or (($current_day == {Tue}) and ($current_time < $time_max)) }
{
HTTP::redirect http://maintenancesplashpage.com/
}
}
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
