Forum Discussion

Koti_Reddy_Koll's avatar
Koti_Reddy_Koll
Icon for Nimbostratus rankNimbostratus
Jul 21, 2019

http uri rewrite iRule help

Folks, I have a requirement to rewrite http URI path from /abc/xyz to /SP/def/CRM (not through http redirect or ProxyPass).

 

Client request: http://company.com/abc/xyz

BIG-IP should forward the request to pool/pool member as per below.

server receive request: http://company.com/SP/def/CRM

 

 

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    give a try

    when HTTP_REQUEST {
        if {[string tolower [HTTP::host]] starts_with "company.com" && [string tolower[HTTP::path]] eq "/abc/xyz"} {
             pool pool
            HTTP::uri "/SP/def/CRM"
        }
    }
    • Koti_Reddy_Koll's avatar
      Koti_Reddy_Koll
      Icon for Nimbostratus rankNimbostratus

      Hi Snl,

      thanks for your response. I’m getting a syntax error while trying the iRule.

    • Koti_Reddy_Koll's avatar
      Koti_Reddy_Koll
      Icon for Nimbostratus rankNimbostratus

      Hi Niels,

       

      thanks for your response. I tried to create a http rewrite profile and got stuck at policy options especially I don’t find Requires setting and control settings options. I’m running with 12.1.2 ver.

       

      1. For the Requires setting, select http from the Available list, and move the entry to the Selected list using the Move button.
      2. For the Controls setting, select forwardingfrom the Available list, and move the entry to the Selected list using the Move button.