Forum Discussion
Curtis_18555
Nimbostratus
Mar 17, 2008Multiple Host going to one vip
Hello, I am working with a client that has many URL that they want to go to one. I have tried the following and it did not work. Can some one please point me in the right direction on this?
This should work with or without "www" in front of the URL and get all of the .com, .net & .org
if it is one of these URL then redirect it to the https://www.google.com
when HTTP_REQUEST {
if {[HTTP::host] contains "google" or "yahoo" or "ask" or "msn"} {
HTTP::redirect https://www.google.com
}
}
Thank you for your help.
- The_Bhattman
Nimbostratus
You might want to try using the switch statement (only because it's cleaner to look at, atleast in my mind 😄when HTTP_REQUEST { switch -glob [HTTP::host] { "*google*" { HTTP::redirect https://www.google.com } "*ask*" { HTTP::redirect https://www.google.com } "*msn*" { HTTP::redirect https://www.google.com } } }
- Curtis_18555
Nimbostratus
Thank you, This worked great! Now that I have this working I am having a problem with all of these certs going to one. I do have a Redirect/Rewrite HTTP Profile set up on this VIP, But the client still gets Security Alert that “The Name on the security certificate is invalid or does not match the name on the site” Do you have any thoughts on how I can fix this problem? And again thank you for your help. - Nicolas_Menant
Employee
Hi, - Curtis_18555
Nimbostratus
I understand what you are say here, But I am useign this iRUle to rediest 10+ URL's to one, and yes they are all https (443). So I need to find out how not get the Security pop ups and still be redirected. Thanks for your help. - Nicolas_Menant
Employee
hi, - hoolio
Cirrostratus
If the hosts aren't on the same domain, you could also try getting a certificate with multiple subject alternate names (SANs). Try searching online or in this forum for some additional info. - The_Bhattman
Nimbostratus
Yep, unfortuantly there is no way to intercpet the https request to look for that information before the security alert is presented. You have hit the check and egg with this one. Wildcard is usually the only answer as, nmeanant has stated.
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