Forum Discussion
Shahbaz_Mokaria
Nimbostratus
Oct 17, 2006remove part of hearder
I am trying to change the URL from http://abc.cde.com/xyz/inventory.do?tt
to
http://abc.cde.com/inventory.do?tt
I tried following rule but it changed the whole url to real server behind F5.
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri contains "/stores" } {
HTTP::header sanitize "/stores"
}
}
Any help or hint will be appriciated.
Thanks.
2 Replies
- hoolio
Cirrostratus
Hello,
It sounds like you want to remove a directory from the URI in a client request before the request is sent to the pool.
You can use HTTP::uri to set the URI and a string function to manipulate the original requested URI.
Here is a rough example:when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] if { $uri starts_with "/stores" }{ HTTP::uri [string map -nocase {"/stores" ""} $uri] } }
I think string map should accept "" as the replacement string. If it doesn't you might want to use another string function to remove the first seven characters of the URI instead of string map.
This post has some background info and additional options (Click here)
Hope this gets you started.
Aaron - Shahbaz_Mokaria
Nimbostratus
It worked!!,
Thanks Aron.
Shabaz
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