Forum Discussion
Richie_66774
Nimbostratus
Aug 01, 2008Domain name with SSL Rewrite
I was trying to do a domain name rewrite to avoid SSL popups:
This is not good code but to help with my explaination this is what I am trying to accomplish:
1. I need the Domain to always be SSL or when you remove the httpS:// it still shows up. I also need the domain to be SSL when you come into the site correctly.
2. I also need the domain to go to WWW.DOMAINNAME.COM so we do not get the SSL popups when people come into our site with the non-FQDN.
when HTTP_REQUEST {
if {[HTTP::host] contains {DOMAINNAME.COM}}
{HTTP::redirect "https://www-[getfield [HTTP::host] : 1][HTTP::uri]" }
}
Thanks DevCentral!!
Rich
4 Replies
- Singh_74932
Nimbostratus
May be some thing like this :
if (http::host contains "domainname.com") {
redirect to "https://www.domainname.com[http::uri]"
}
lets see what experts say . - Richie_66774
Nimbostratus
Thank you for the reply I had to get something out for our sites currently this is what I am using which is very simular to what you just posted; we host many sites in our LTM and I was hoping there is a way to make this a little more dynamic rather than my static irule.
when HTTP_REQUEST {
if {( [HTTP::host] equals "domain.com" ) or ( [HTTP::host] equals "www.domainname.com" )}
{ HTTP::redirect https://www.domainname[HTTP::uri] }}
Thank you!! - Richie_66774
Nimbostratus
Hello everyone, does anyone know how to handle HTTPS to HTTPS? Example
We need an HTTPS://domainname.com to always rewrite in the address bar as HTTPS://www.domainname.com I have tried HTTP:uri contains "secure" and it does not work correctly so I am out of ideas...
Again this is to avoid SSL popups.
Thanks - Richie_66774
Nimbostratus
Thank you for your response I tried the code above and had a couple of questions if I may:
80:
When I execute the Port 80 code browsing by IP does not work because of the appended www.IPADDRESS. I tried an or ([HTTP::host] starts_with "IP") and that did not work but will keep trying.
443:
also the Port 443 code does not seem to work because it is not rewriting the URL therefore I still get the SSL mismatch warning.
Thanks for all your Help!
Rich
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
