Forum Discussion

Helmi_Muzammil's avatar
Helmi_Muzammil
Icon for Nimbostratus rankNimbostratus
Oct 22, 2020

Rewrite URL and Virtual Server Selection

Hi All,

 

I have 2 web server url binding to 2 VS in F5,

 

  1. oa.f5.com = VS_OA
  2. office.f5.com = VS_Office

 

I want to achieve, if the user type http://oa.f5.com/nadine then it will go to http://office.f5.com/

 

I have created the irule in VS_OA as below, but no success ( the traffic still go to VS_OA with error 404 due to no nadine folder)

 

 

 

when HTTP_REQUEST_RELEASE {

 if {[string tolower [HTTP::host]] starts_with "oa.f5.com" && [HTTP::uri] starts_with "/nadine" } {

  HTTP::host "office.f5.com"

  HTTP::uri [string map {"/nadine" "/"} [HTTP::uri]]

  virtual VS_Office

 }

}

 

1 Reply

  • how do you determine that traffic doesn't go to VS_Office?

     

    do keep in mind that these rewrites only have an effect on the server side, the client will still see oa.f5.com but the traffic should go internally to VS_Office

     

    a lot will depend on what the backend server is showing and if there isn't a redirect that just sends you to oa.f5.com again.