Forum Discussion
hooleylist
Oct 18, 2010Cirrostratus
Hii Mike,
You can use 'string range' to parse the original URI. I've added URI encoding of the URI to ensure there aren't any encoding errors in the redirect. If that's not what you want, you can remove that portion.
TCL string range man page
http://www.tcl.tk/man/tcl8.4/TclCmd/string.htmM40
when HTTP_REQUEST {
Check if URI starts with /update
if {[string tolower [HTTP::uri]] starts_with "/update"}{
Redirect the request
HTTP::redirect "http://www.mysite.com/profile/beta/page.aspx?id=[URI::encode [string range [HTTP::uri] 7 end]]"
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting [HTTP::uri]\
to http://www.mysite.com/profile/beta/page.aspx?id=[URI::encode [string range [HTTP::uri] 7 end]]"
}
}
Aaron