Forum Discussion

Neeharika_Redd1's avatar
Neeharika_Redd1
Icon for Nimbostratus rankNimbostratus
Mar 18, 2015

HTTP::URI not working

Hi,

 

I have a scenario where all HTTP::URI should be appended with "test". For example, below is my iRule -

 

when HTTP_REQUEST {

 

HTTP::uri [HTTP::uri]/test

 

log local0. "[HTTP::uri]"

 

}

 

I do see the logger message like below in /var/log/ltm, but the URL is not actually changing.

 

Mar 18 18:06:24 pcs-dc-lb5 info tmm1[8333]: Rule /Common/POC : /myuri/test

 

On the browser, the URL is still http://{mysite}/myuri

 

I do have other iRules that use similar concept of [HTTP::uri] and works. I'm not sure why the above iRule is not working.

 

Could anyone please help here?

 

Thanks, NR

 

2 Replies

  • When you use the

    HTTP::uri
    method in an iRule, it changes the URI on that request to whatever you set it to, but that doesn't change the client's URI. The back-end server will see the URI as the updated value, but not necessarily the client.

    A way to make this work would be to perform a redirect instead (

    HTTP::redirect
    ) using the new uri, which would redirect the client to the desired page and change the browser url.

  • Thanks Michael! Will have to ensure HTTP::redirect doesn't end up in redirect loop...