Forum Discussion
Brendan_Newell_
Nimbostratus
Sep 12, 2005uri rewrite rule
If anyone can provide any assistance with the following then it would be much appreciated:
I have a customer who wants an irule to rewrite the uri so that when the user connects to the virtual server, they are passed through to the backend host with a slightly different uri.
eg.
user connects to http://www.virtualserver.com/test/index.html
user is directed to http://www.backendhost.com/sample/test/index.html
Many thanks!
6 Replies
- Colin_Walker_12Historic F5 AccountSo you're looking for something like this, I believe:
when HTTP_REQUEST { if{([HTTP::host] equals "virtualserver") and ([HTTP::uri] contains "test")} { HTTP::redirect "http://www.backendhost.com/sample[HTTP::uri]" } } -Colin - Brian_Gupta_115
Nimbostratus
Colin,
I don't think he is looking for a redirect... It seems he is looking for a transparent URI rewrite:
HTTP::uri "sample[HTTP::uri]"
Cheers,
Brian - Brendan_Newell_
Nimbostratus
Many thanks guys, we have actually solved this now - I didnt think anyone was reading this thread so I didnt update it.
Cheers anyway :-) - You can use the HTTP::uri command to change the URI passed to the backend server.
Check out my blog post covering this one:
http://devcentral.f5.com/weblogs/joe/archive/2005/07/27/ModifyingUriWithoutRedirect.aspx
Click here
-Joe - Thomas_Laubrock
Nimbostratus
Really!
Is it so simple?
Thanks
Thomas - hoolio
Cirrostratus
Hi Don,
Can you enable debug on the iRule and post the anonymized logs from /var/log/ltm for a request to the home page and the following references? Can you use a browser plugin like HttpFox for Firefox or Fiddler for IE to see what is wrong with the image references?
Aaron
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