Forum Discussion

Fereda_187281's avatar
Fereda_187281
Icon for Nimbostratus rankNimbostratus
Oct 27, 2015
Solved

URI Translation and redirect help

Hello all;   I am using the BigIP v 11.6.   My users will in the browser put (https://abc-abc.abc.com/abc/example.asp=1) my redirect states redirect to "https://backendserver/xyc/example.asp=1...
  • Brad_Parker_139's avatar
    Oct 27, 2015

    In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.

    when HTTP_REQUEST {
        if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{
            HTTP::host "backendhostheader"
        }
        HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]]
    
        Disable the stream filter for all requests
       STREAM::disable
    
        LTM does not uncompress response content, so if the server has compression enabled
        and it cannot be disabled on the server, we can prevent the server from 
        sending a compressed response by removing the compression offerings from the client
       HTTP::header remove "Accept-Encoding"
    }
    when HTTP_RESPONSE {
           Replace http:// with https://
          STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@}
    
           Enable the stream filter for this response only
          STREAM::enable
       }
    }