Forum Discussion

CHRISTY_THOMAS's avatar
Jun 15, 2024

Dynamic url redirection feasibility

In one of the BIG –IP integrated application need to redirect a dynamic url to other one.

 

Requirement description:

“”

Client require the call back API to FED bank endpoint in format : IP:port/udir/RespChkTxn/…..  . Since we are using the IBM’s product we will have our url in format https://apiuatgwy.fedbank.com/fed/uat/udir/RespChkTxn/ . client at their end cannot append /fed/uat since this is uniform format across call banks. Hence kindly check if the url redirect may be possible before it reaches gateway.

 

Original url by npci example:

https://apiuatgwy.febbank.com/udir/RespChkTxn/1.0/urn:txnid:SIBJfYoPALjqHtdLbdDbLbp1YEQ7DZFV5LR

url to be redirected :

https://apiuatgwy.fedbank.com/fed/uat/udir/RespChkTxn/1.0/urn:txnid:SIBJfYoPALjqHtdLbdDbLbp1YEQ7DZFV5LR

 

“”

 

  1. Whether it is possible to redirect/rewrite dynamic url’s in BiG-IP?
  2. Share the irule/redirect/rewrite etc. configuration for achieving the above requirement

 

Regards

Christy Thomas

2 Replies

  • Assuming that you don't really have to pay any mind to the piece following this path "/udir/RespChkTxn/1.0/urn" because the remainder is dynamic the following should work. If you wish to have to have another redirect other than 302 then you could use HTTP::respond with the appropriate HTTP status value.

    when HTTP_REQUEST priority 500 {
    
        set URI [string tolower [HTTP::uri]]
    
        if { [HTTP::host] eq "apiuatgwy.fedbank.com" } {
    
            if { ${URI} starts_with "/udir/respchktxn/1.0/urn" } {
                HTTP::redirect "https://[HTTP::host]/fed/uat[HTTP::uri]"
            }
    
        }
    
    }