Forum Discussion
Kapil_Sharma_61
Nimbostratus
Sep 14, 2005HTTP 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
- Brian_Gupta_115
Nimbostratus
What URL is the webserver expecting? - Brian_Gupta_115
Nimbostratus
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 - Kapil_Sharma_61
Nimbostratus
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_127330Historic F5 AccountIn that case, you should do what I originally suggested.
when HTTP_REQUEST { HTTP::uri "/test[HTTP::uri]" } - unRuleY_95363Historic F5 AccountIn 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.
- Brian_Gupta_115
Nimbostratus
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects