Forum Discussion
trying to redirect one https url to another
We have SSL cert for one domain1 but not for domain2. Our links are all relative and a link works just fine. However generates a SSL cert error as expected.
In order to get around that without having to hard code the contactus links on domain2 to domain1, i am trying to write an iRule. I tried the one below but the page still gives me the SSL cert error and then redirects to domain1 instead. Any ideas?
when HTTP_REQUEST {
if { ([HTTP::host] contains "domain2") and (([HTTP::uri] contains "view=contactus") or ([HTTP::uri] contains "view=emailto"))
}
{ HTTP::respond 301 Location "https://domain1[HTTP::uri]"
}
}2 Replies
- VernonWells
Employee
The TLS negotiation occurs before any higher layer messages are exchanged. Even if you configured the web server to respond with a redirect, you would still get the cert warning. This is by design. Otherwise, a man-in-the-middle could inject a redirect (or really, any response) without the client knowing that it was not coming from the intended endpoint.
- JB_41040
Nimbostratus
thanks for the quick response.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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