If you just want to rewrite requests to the root document (path equals /), you could use this:
when HTTP_REQUEST {
Check if path is /
if {[HTTP::path] eq "/"}{
Rewrite path to /test/app.aspx
HTTP::path "/test/app.aspx"
}
}
If you want to prepend a string to all URIs if it's not there already, you can use a rule like this:
when HTTP_REQUEST {
Check if path doesn't already start with /test/
if { not ([HTTP::path] starts_with "/test/")}{
Rewrite path by prepending "/test/"
HTTP::path "/test/[HTTP::path]"
}
}
Note that if you don't care about inspecting the query string it should be more efficient to modify just the path using HTTP::path.
Aaron