Forum Discussion
Joshua_106551
Feb 25, 2011Nimbostratus
how do I append a simple URI
I am looking to take a simple url and add "/sc/pol" every time the request comes through.
5 Replies
Sort By
- Here is what I have so far.
- Here is a down and dirty way to do what you are looking for,
- Opps didn't see your second post...I would do this if you might have a query string that needs to stay.
- Nice one stjbrown. You could add a sanity check that the path doesn't already have the string as well.
when HTTP_REQUEST{ if {[HTTP::host] contains "test" and not ([HTTP::path] ends_with "/sc/pol") }{ Due to a bug in v10.0 - 10.2.1, HTTP::path truncates the HTTP query string if present. This is described in CR142756. This should be fixed in 10.2.1HF1. Check if there is a query string if {[HTTP::query] eq ""}{ No query string, so append the string to the path HTTP::uri "[HTTP::uri]/sc/pol" } else { Append the string to the path and re-append the query string HTTP::uri "[HTTP::path]/sc/pol?[HTTP::query]" } } }
when HTTP_REQUEST{ if {[HTTP::host] contains "test" and not ([HTTP::uri] ends_with "/sc/pol") }{ HTTP::uri "[HTTP::uri]/sc/pol" } }
- Oh, very good to know about the bug in v10!
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