Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Apply splash page for single url on multiple url hosted virtual server

Hi All

I want to write a iRule including ifiles to accommodate below scenario

site 1:- www.abc.com site 2:- www.efg.com

resolves single public IP address :- 123.1.1.5

when user tries to access www.abc.com splash page should be given, if user tries to access www.efg.com user should get the original web page as return.

when HTTP_REQUEST if user tries www.abc.com return normal page else user tries www.efg.com { HTTP::respond 200 content [ifile get "www_efg_maintenance_page"] }

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

will below method work ?

when HTTP_REQUEST { set host [string tolower [HTTP::host]] set requiredHost1 "www.abc.com"; set requiredHost2 "www.efg.com";

if {$host == $requiredHost1} {HTTP::respond 200 content [ifile get "abc-holding_page"]}
elseif {{$host == $requiredHost2}{ pool efg-pool }
}

}

0
Comments on this Answer
Comment made 22-Feb-2018 by Dan Bowman 227

You could probably simplify that a little assuming your pool is assigned to your VS. Also no need to assign variable if you're only using it once.

when HTTP_REQUEST { 
set host [string tolower [HTTP::host]]  

if {$host eq  "www.abc.com"} {
    HTTP::respond 200 content [ifile get "abc-holding_page"]
}
}
0