Forum Discussion
Chad_Emerson_85
Nimbostratus
May 18, 2006Easy redirect?
How would you guys recommend doing the follwoing?
A user hits a url https://www.bcbsal.com/webapps/providerfinder/jsp/find.jsp
I need it to change to https://www.bcbsal.org/webapps/providerfinder/jsp/find.jsp
I already have a rule that auto redirects the user if the request is http. It is below.
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
Am I going to have to do some string manipulation to find and replace the .com with .org?
Like this but I have something wrong...
when HTTP_REQUEST {
if { [HTTP::host] contains "bcbsal.com"} {
HTTP::redirect https://www.bcbsal.org/[HTTP::uri]
} else {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
Thanks!
- Deb_Allen_18Historic F5 AccountYou're probably getting a redirect to:
when HTTP_REQUEST { if { [HTTP::host] contains "bcbsal.com"} { HTTP::redirect https://www.bcbsal.org[HTTP::uri] } else { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
- Chad_Emerson_85
Nimbostratus
Cool that worked... sorta. One question. How can I make it change the follwoing https://bigtest.bcbsal.com/doctor/index.cfm to https://bigtest.bcbsal.org/doctor/index.cfm - Chad_Emerson_85
Nimbostratus
One more thing. I am terminating ssl on my LTM. - Deb_Allen_18Historic F5 AccountWell, if you want to send a redirect in response to an HTTPS connection, you still have to complete the handshake to send the redirect, so even if you are terminating SSL on the BIG-IP, that won't really relieve you of the problem of the expiring .com cert.
(You would NOT want to include the second condition if you are going to apply this rule to an HTTPS virtual, or any request with a host header NOT containing bcbsal.com will be caught in an endless redirect loop.)when HTTP_REQUEST { if { [HTTP::host] contains "bcbsal.com"} { HTTP::redirect https://[getfield [HTTP::host] ".bcbsal.com" 1].bcbsal.org[HTTP::uri] } }[
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