sidiov
Mar 17, 2009Nimbostratus
Redirecting specific java strings in uri
I have a redirection query that currently redirects the root page based on the browser type.
when HTTP_REQUEST {
if { [HTTP::path] equals "/" }{
if { [HTTP::header "User-Agent"] contains "soviet" }
{HTTP::redirect "http://soviet.com/"}
}
}
this works just fine.
However now I have to pick a specific instance where a jquery is passed in the uri to NOT redirect. I tried the following, but it prevented all access to the site from the browser.
when HTTP_REQUEST {
if { [HTTP::path] equals "/" }{
if { not [string tolower [HTTP::uri]] starts_with "/?user=soviet" }{
if { [HTTP::header "User-Agent"] contains "soviet" }
{HTTP::redirect "http://soviet.com/"}
}
}
}
What would the correct way of doing this be?