For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Kapil_Sharma_61's avatar
Kapil_Sharma_61
Icon for Nimbostratus rankNimbostratus
Sep 14, 2005

HTTP Response

Hi,

 

I am trying to add a prefix to the URI before sending the response to the client.

 

For example, the server responds with the URI /sample/page.html

 

and I want to send to the client /test/sample/page.html

 

 

Thanks,

 

kapil

16 Replies

  • Do you want the F5 to send a client redirect for those requests that start with /test to the same URL without /test? After which the loadbalancer will send the redirected request (without /test) to the backend webserver?

     

     

    -Brian
  • Hi,

     

    The internal web server is expecting ths URL:

     

    http://{web server address}/sample/page.html

     

     

    i just want to add /test with the URL on HTTP_RESPONSE so that the URL will become

     

     

    http://{web server address}/test/sample/page.html

     

     

    on the client side.

     

     

    I don't want to use HTTP_REDIRECT.

     

     

    Thanks,

     

    Kapil

     

     

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    In that case, you should do what I originally suggested.

    
    when HTTP_REQUEST {
       HTTP::uri "/test[HTTP::uri]"
    }
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    In that case, you'll need to either use the stream profile which will search and replace a string in the content with another string; or use an iRule to collect the response and then search and replace the uri's. Click here to see an example that replaces credit card numbers or social security numbers with X's.
  • Microgen,

     

     

    I think I understand what you want. You will need a rule with two parts.

     

     

    In the first part of the rule you will need to remove /test from the requested URL before passing the request to the backend webserver. (I took a stab at this in my first iRule example, I am willing to work with you on this offline if you wish - It's gonna need some testing and tweaking)

     

     

    In the second part you will need to add /test back in the html data during the server response. See the following article for an explanation of how to do this. http://devcentral.f5.com/Default.aspx?tabid=29&articleType=ArticleView&articleId=56

     

     

    Does this sound like what you want? (I am assuming you want to be able to access the same webservers content tree with two different URIs (With /test and without).

     

     

    Cheers,

     

    -Brian