gh0std0g_79292
Apr 12, 2012Nimbostratus
http -> https redirection and hostname replace not working
any ideas?
any ideas?
when HTTP_REQUEST {
set H [HTTP::host]
if { [string match "aaa.xyz.com" $H] } {
HTTP::redirect https://ccc.xyz.com/oa_html/ibuhpage.jsp
return
}
if { [string match "bbb.xyz.com" $H] } {
HTTP::redirect https://ccc.xyz.com/oa_html/appslocallogin.jsp
return
}
}
The code just sends a 302 HTTP redirect, shouldnt drop https://->http:// unless there is a server that isnt responding on https:// in the first place (because the 302 fails from the client browser).
...or the server itself sends its own 302 to point back at http://, but I cannot see why anyone would do that who intended to host SSL in the first place
when HTTP_REQUEST {
if { [HTTP::host] equals "aaa.xyz.com" and [HTTP::uri] equals "/"} {
HTTP::redirect "https://ccc.xyz.com/oa_html/ibuhpage.jsp"
} elseif { [HTTP::host] equals "bbb.xyz.com" and [HTTP::uri] equals "/" } {
HTTP::redirect "https://ccc.xyz.com/oa_html/appslocallogin.jsp"
}
}