Forum Discussion
Richie_66774
Nimbostratus
Sep 15, 2009Redirect a small URL to the real URL
I am trying to rewrite a request that I receive like this:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/anything" } {
HTTP::uri "/default.aspx?=anything" ...
hoolio
Cirrostratus
Sep 15, 2009Do you want to take the whole URI and set it as a parameter value? If so, you should URI encode the value:
when HTTP_REQUEST {
Check if the URI set to lower case starts with /anything
if { [string tolower [HTTP::uri]] starts_with "/anything" } {
Rewrite the URI to /default.aspx with a new parameter and the value set to the URI encoded original URI
HTTP::uri "/default.aspx?original_uri=[URI::encode [HTTP::uri]]"
}
}
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