Forum Discussion

Thanushka_Wije1's avatar
Thanushka_Wije1
Icon for Nimbostratus rankNimbostratus
Feb 22, 2018

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:- site 2:-

 

resolves single public IP address :- 123.1.1.5

 

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

 

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

 

2 Replies

  • will below method work ?

    when HTTP_REQUEST { set host [string tolower [HTTP::host]] set requiredHost1 "; set requiredHost2 ";

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

    }

    • Dan_Bowman's avatar
      Dan_Bowman
      Icon for Cirrus rankCirrus

      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"]
      }
      }