Forum Discussion
gh0std0g_79292
Nimbostratus
Apr 12, 2012http -> https redirection and hostname replace not working
any ideas?
2 Replies
- Antony_413
Nimbostratus
how's this go for you?
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 - nitass
Employee
can you try this?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" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects