I-rule redirect advise
I have tested an http redirect i-rule and this works. However, the user wants me to redirect to a completely different site for another uri request.
For the first, ccsweb redirects to cta.lanl.gov as expected.
when HTTP_REQUEST {
if ![HTTP::has_responded] {
#set request [HTTP::uri]
if {[string tolower [HTTP::host]] equals "ccsweb.lanl.gov" }{
# HTTP::respond 301 Location "https://cta.lanl.gov" Strict-Transport-Security "max-age=31536000"
HTTP::redirect https://cta.lanl.gov
return
}
}}
However, for they also want https://cssweb.lanl.gov/~pakin to redirect to https://lanlexperts.elsevierpure.com/en/persons/scott-d-pakin when inputting https://ccsweb.lanl.gov/~pakin.
I'm not sure if a redirect irule can work to 2 different sites from the same virtual server. The second irule looks like this.
when HTTP_REQUEST {
if ![HTTP::has_responded] {
#set request [HTTP::uri]
if {[string tolower [HTTP::host]] equals "https://ccsweb.lanl.gov/~pakin" }{
# HTTP::respond 301 Location "https://cta.lanl.gov" Strict-Transport-Security "max-age=31536000"
HTTP::redirect https://lanlexperts.elsevierpure.com/en/persons/scott-d-pakin
return
}
}}
Any suggestions on combining these 2 i-rules? What is missing if the second redirect doesnt trigger?