Is there a way to grab part of the URI and insert into the redirected URL?
Example:
redirect http://domain.com/bookstore/detail.asp?sku=xxxx (extract xxxx)
to http://newdomain.com/(insert xxxx).aspx
I have never had to do something this complex before…any help is much appreciated!
Hamish
2
Absolutely.
You can grab the parameter provided to the URI using the 'URI::query ’ command. So something like
set extract [URI::query [HTTP::query] “sku” ]
will set the variabe $extract to the value passed in the sku parameter. Then simply include the variable in the redirect command. e.g.
HTTP::redirect “http://newdomaind.com/$extract.aspx”
H
Got it…it’s working…thanks for the help!