I think it would be a little bit easier to read and maintain by removing the need for the substr.
Temporary Redirect:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/v1234" } {
HTTP::redirect is a 302 Temporary Redirect
HTTP::redirect "https://[HTTP::host]/default.aspx?[HTTP::query]"
}
}
Permanent Redirect:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/v1234" } {
HTTP::redirect is a 302 Temporary Redirect
HTTP::respond 301 Location "https://[HTTP::host]/default.aspx?[HTTP::query]"
}
}
From your example:
https://www.xxx.yyy.com/default.aspx?id=9999999-99
HTTP::host Value:
www.xxx.yyy.com
HTTP::path Value: default.aspx
HTTP::query Value: id=9999999-99
The HTTP::path goes upto the ? of the query string, but does not include it.
The HTTP::query starts up after the ?, but doesn't include it either, so you must manually ad it to your HTTP::path.
What Bhattman provide will work, but it is actually writing out the default.aspx?id= and the [substr [HTTP::query] 3 0] is deleting the id= and then writing out the HTTP::query value.