Forum Discussion

krmidhun_323560's avatar
krmidhun_323560
Icon for Nimbostratus rankNimbostratus
Aug 09, 2017
Solved

iRule redirect with URL masking and URI rewrite

Hi,   I am looking for a iRule to do a URL redirection and also appending a URI to the redirected URL. The redirected URL should be masked so that the client will not see that in the address bar. ...
  • Yann_Desmarest_'s avatar
    Aug 09, 2017

    Hi,

    You can't achieve what you are expecting without using iframes. But I strongly discourage you to use them for security reasons.

    You can instead redirect to a relative path and then forward the request to the correct backend server :

    `

    when HTTP_REQUEST { 
    
        if { [HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/" } {
            HTTP::redirect "/apm/rest/MOBILITY/authService/1.0" 
            return
        }
        if {[HTTP::host] contains "buyer.abc.com" and [HTTP::path] eq "/apm/rest/MOBILITY/authService/1.0"} {
            node myserver01 9001
            return 
        }
    }
    

    `