URI Redirect only using a portion of the original URI
I usually dont like to ask for help since DevCentral usually has posts that I can manipulate or dissect and get what I need with a little bit of tuning.
Essentially I need to only grab a portion of URI and insert it into the redirect.
So here is the basics of what I am trying to do.
When request comes in matching the below
Redirect to:
But the only portion of the URI I now need is
?verifyPasswordToken=&token=8AD4316AB786615C9F54D25A5572EE8C77B87BDB
instead of the full URI
MyTest/ResetPassword.action?verifyPasswordToken=&token=8AD4316AB786615C9F54D25A5572EE8C77B87BDB
So from ?verifyPasswordToken(always stays the same) to the end of the URI(which will change) I now need to append that into the redirect
This is the rule I had in place before realizing I was grabbing the whole URI
when HTTP_REQUEST {
if {[HTTP::host] equals "test.this.com" } {
if { [HTTP::uri] contains "ResetPassword.action?verifyPasswordToken=&token=" } {
log "matched reset password"
HTTP::redirect "https://www.testthis.com/en-us/home.html[HTTP::uri]"
} elseif {[HTTP::host] equals "test.this.com" } {
if { [HTTP::uri] equals "/MyTest" } {
log "matched root URL"
HTTP::redirect "https://www.testthis.com/en-us/home.html"
}
} } }
Any pointers would help.