Forum Discussion
Irule redirect on 443 VIP domain.com to www.domain.com
I think I must be missing something simple.
I have an irule setup on my port 80 vip. This works great. If I request http://domain.com/ it will redirect to https://www.domain.com/ and also if you request http://www.domain.com/ it will redirect to the https://www.domain.com/
I have a 443 VIP setup with a client side SSL profile setup that is working just fine. I want to accomplish a redirect from https://domain.com to https:/www.domain.com.
Browsing to domain.com doesn't work because the cert is only for www.domain.com.
If I apply to same Irule to the 443 VIP I just get a 404 when trying to hit the site.
Here is the Irule Below
when HTTP_REQUEST { if { (([HTTP::host] equals "domain.com") or ([HTTP::host] equals "www.domain.com")) } { HTTP::redirect "https://www.domain.com" } }
- Eric_St__JohnEmployee
You would not want to redirect "www.domain.com" to "https://www.domain.com"
Try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "domain.com" } { HTTP::redirect "https://www.domain.com" } } }
- Kevin_Bozman_15Nimbostratus
And that should work on the 443 VIP correct? Getting ready to leave for vacation. I'll check it out when I get back.
- shaggyNimbostratusit should as long as the 443 vip has a client-ssl profile and http profile assigned. make sure the 80 VIP isn't configured to redirect 80 traffic to 443 (since http-to-https redirects are the norm)
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