Forum Discussion
extremeboozer_3
Nimbostratus
Oct 23, 2007Insert new URL
Even though myself and my co-worker pride ourselves in being rule hacks we still have yet to figure out how to write a rule to change the destination URL of an HTTP request without redirecting the cli...
Oct 23, 2007
A HTTP::redirect will issue a full HTTP redirect to the client browser, change the address bar, and have the browser send a new request to the server. This is likely what you have discovered. If you wish to just "change" the URI so the backend server sees something different than the client browser, you can do so with a combination of the "Host" header and the HTTP::uri command.
Here's an example:
when HTTP_REQUEST {
HTTP::header replace "Host" "foobar.com"
HTTP::uri "/some/new/path"
}This will turn any request you send to the virtual server, into this into the backend
http://foobar.com/some/new/path
without sending a redirect to the client. The client still thinks he's going to http://coolstuff.com/buysomething.
Of coarse, you can do either the Host Or the URI or both if you want, I just illustrated how to do it for the full URI.
Check out the wiki docs on those two methods for more info.
-Joe
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