For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

N__197982's avatar
N__197982
Icon for Nimbostratus rankNimbostratus
Sep 19, 2015

need some help on a host rewrite iRule.

Folks,

 

We have a VIP "xyz.mycompany.com" configured to listen on https. The SSL profile configured also has the certificate for hostname "xyz.mycompany.com".

 

However few folks still access this with the old hostname "abc.mycompany.com" for which the certificate hostname does not exist and hence is giving out an error.

 

Our goal is to allow our clients to use the old hostname and still get redirected to the new hostname with any SSL errors. Will the below iRule suit our requirement?

 

Will end users understand that something has changed?

 

when HTTP_REQUEST { if { [HTTP::host] eq "abc.mycompany.com" } { HTTP::header replace "Host" "xyz.mycompany.com" } }

 

Thanks!!

 

1 Reply

  • Hi, I think is better redirect the client to the new host name, but that does not solve the certificate error on the first access to the old host.

    Change the content header in the http request will only take effect to the server side. So, why do you not create a VS:80 and also redirects to? I think most people first goes to http instead of https.
     for both HTTP and HTTPS
    when HTTP_REQUEST {
        if { [HTTP::host] ne "xyz.mycompany.com" } { 
            HTTP::redirect "https://xyz.mycompany.com[HTTP::uri]" 
        } 
    }
    

    Hope it helps.