Forum Discussion
hooleylist
Jun 22, 2010Cirrostratus
Hi Bruce,
You can parse the value for a URI parameter using a slight change to URI::query:
URI::query "?&[HTTP::query] ¶m_name
So to parse the value of the Ntt parameter and use it in a URI rewrite, you can do something like this:
when HTTP_REQUEST {
Check if some condition is true?
if { [string tolower [HTTP::host]] eq "search.environment.domain" and [HTTP::path] eq "/listing" and [HTTP::query] contains "Ntt"}{
Rewrite the URI with the original path and the query string replaced
with just the Ntt parameter value set for the q parameter
HTTP::uri "/globalSearch?q=[URI::query "?&[HTTP::query] &Ntt]"
Update the host header
HTTP::header replace Host "www.environment.domain"
}
}
Aaron