There is a way to do it but you need to make sure you follow the config as follow
The pool name have to be in lower case and equal to the domain name. This is because we are getting the Header from the request and change it to lower case
In this Irule, I am adding the word pl_ but you can remove it
Example
Http or https://abc.123.com the pool name have to be abc.123.com
when HTTP_REQUEST {
set the host name and url to lower case
set Vuri [ string tolower [HTTP::uri]]
set Vheader [string tolower [HTTP::host]]
set the Poolname variable.
set Poolname "$Vheader"
set the default site name variable
set SiteName "XXXX.MAINTENANCEPAGE.org"
set Irulename "Irule_$SiteName"
set SiteRedirect "https://$SiteName"
Obtain active poolmembers count and list
set Poolmember [active_members $Poolname ]
set Poolmemberlist [ active_members -list $Poolname]
if {$Poolmember < 1} then {
log local0.alert "ALERT-TEAM Pool $Poolname is down. This mean $SiteName website is down. IRULE=$Irulename";
HTTP::redirect "http://www.YOURPAGE-OFFLINE.COM"
}
pool $Poolname
}