Forum Discussion

neeraj2901_2661's avatar
neeraj2901_2661
Icon for Nimbostratus rankNimbostratus
Mar 02, 2017

Single server for Multiple URLs

I have 5 URLs which has single server. VIP1-VIP5 and one server (Server1) Server1 has 5 URL based on URI, like:

 

Server1.com/test/id=1, Server1.com/test/id=2, Server1.com/test/id=3 , Server1.com/test/id=4, Server1.com/test/id=5

 

I want that when user types:

 

  1. VIP1.com gets redirected to VIP1.com/test/id=1
  2. VIP2.com gets redirected to VIP2.com/test/id=2

goes on

 

1 Reply

  • You can use 1 VS with a pool that has 1 pool member (server). Use iRule to redirect based on the incoming domain. The following iRule is untested and would have to be modified to suit your specific use-case:

    When HTTP_REQUEST {
    if { [HTTP::uri] eq "/" } {
    switch -glob [HTTP::host]
    "VIP1.com" { HTTP::redirect [HTTP::host]/test/id=1 }
    "VIP2.com" { HTTP::redirect [HTTP::host]/test/id=2 }
    }
    }