Forum Discussion
Help with redirecting http to https irule
Hi,
Just like the subject states, we have created a new virtual server on the BIG IP on https that we would like a domain name example.com to be on. What I am looking to do is have http://example.com and http://www.example.com redirect to https://example.com or https://www.example.com. I tried using the built-in irule called _sys_https_redirect but that doesn't seem to work as I get an error saying too many redirects in Chrome. If I remove the irule then the site loads fine on https://example.com but http://example.com and wwww.example.com don't work. I also tried creating the below irule manually and applying it but that gives the same result as above (too many redirects error).
when HTTP_REQUEST {
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
}
One thing to note is that this Virtual server is not only using a clientssl profile thus doing the SSL offloading but it is also using a serverssl profile because the backend server is also running on https using a self signed cert.
Thank you.
- Faruk_AYDIN
Altostratus
you do not need to change your irule.
- ka1021
Altostratus
Create a new VS for port 80 HTTP. and assign http_to_https irule to it. Let above HTTPS virtual server be remain as it is.
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