Forum Discussion

Hamza_derbali's avatar
Hamza_derbali
Icon for Altostratus rankAltostratus
Oct 05, 2024

Rewriting Location Header in iRule

Hello everyone, I'm trying to find a way to manipulate the HTTP::header location. For each redirection containing a location header from the backend server, I need to rewrite just the host part of ...
  • Enes_Afsin_Al's avatar
    Oct 06, 2024

    Hi Hamza,

    when HTTP_RESPONSE {
        if { [HTTP::header Location] starts_with "http://webserver01:8282"} {
            HTTP::header replace Location [string map {"http://webserver01:8282" "https://externallink.com"} [HTTP::header Location]]
        }
    }