Forum Discussion

Richie_66774's avatar
Richie_66774
Icon for Nimbostratus rankNimbostratus
Aug 01, 2008

Domain 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
  • 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 .
  • 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!!
  • 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
  • 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