Forum Discussion

N_67263's avatar
N_67263
Icon for Nimbostratus rankNimbostratus
Aug 28, 2017
Solved

iRule which strips of the domain name and replaces that with another domain name.

Team, Can anyone help me with an iRule which strips of the domain name and does a DNS query with some other domain name? e.g. The F5 intercepts a request on "xyz.externaldomain.com". F5 strips of the...
  • Yann_Desmarest_'s avatar
    Aug 28, 2017

    Hi,

    Maybe the following irule may help you :

    when HTTP_REQUEST {
        if { [HTTP::host] contains "xyz.externaldomain.com" } {
            HTTP::header replace Host "xyz.internaldomain.com"
        }
    }
    

    You may also use

    string map
    command to make the replacement more dynamic