Forum Discussion
Michael_Smith_6
Nimbostratus
Feb 25, 2009HTTP Rewrite
All,
I apologize to be posting something that I think should be simple, but I just can't seem to figure out how to do. I've went through the forum, but I just can't find this specific example. What I have is an instance where I have a pool of web servers sitting behind a pair of LTMs. I need to rewrite the URI coming in and add a string to it on the initial HTTP request being present to the pool. As an example, a client would request http://www.abc.com/file.htm. When this request went to the pool, I would need it to be http://www.abc.com/insertedstring/file.htm. The last part of the uri (file.htm) varies and could be virtually any html file, image, etc. on the web servers serving up content. Any help that anyone can provide me would be greatly appreciated. Thanks in advance.
Mike
2 Replies
- hoolio
Cirrostratus
Hi Mike,
To rewrite the requested path and insert a string, you can use HTTP::path. If the application includes references to the inserted string in response headers or content, you can remove them. Here is an example of the first option. Let me know if you need to rewrite the response.when HTTP_REQUEST { Insert /string/ to beginning of path HTTP::path "/string/[HTTP::path]" }
Aaron - Michael_Smith_6
Nimbostratus
Aaron,
Yep, that did exactly what I needed it to do. Figured it would be something simple. Appreciate you taking the time to respond. Thanks again.
Mike
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
