Forum Discussion

Zuke_254875's avatar
Zuke_254875
Icon for Altostratus rankAltostratus
Sep 01, 2017

URI removal from the hostname

A customer provided a server and pool to sit behind the LTM. He's asked that when users connect to the FQDN, that they're directed to a specific location on the server.

Client-side UA connects to https://dev.domain.com/ Server-side, F5 sends to devserver1.company.com/unwanteduri

I put in the following iRule, which hides the URI from the browser :

when HTTP_REQUEST {
  if { ([HTTP::host] == "dev.domain.com") and ([HTTP::uri] == "/") } {
    HTTP::uri "/unwanteduri/"
  }
}

The page connects and loads, but I'm getting 404s on the server side because the /unwanteduri/ is being removed from the server-side requests.

Should this be done with a stream profile, or can it be completed within just the iRule?