Forum Discussion

john_givler_105's avatar
john_givler_105
Icon for Nimbostratus rankNimbostratus
Dec 21, 2005

Modify Port 80 Redirect IRULE

Hello,

 

I am a developer and we are busy implementing a F5 Big IP 1500. I know nothing about F5 and I am trying to save our content people a bunch of work. I apologize if this question is stupid or has been asked before.

 

 

We are using the below IRULE to Require SSL on a server.

 

 

when HTTP_REQUEST {

 

 

if { [matchclass [string tolower [HTTP::uri]] starts_with $::Intranet_Require_SSL] } {

 

 

HTTP::redirect "https://[HTTP::host][HTTP::uri]"

 

 

}

 

 

}

 

 

The problem is that the site resolves to two URLS but we have only one SSL Certificate. From what I understand, this script will add the https to the url but it won't always resolve to the domain with the SSL certificate and the user will get a that lovely message explaining the url doesn't match the certificate. I was wondering if anyone has could modify this script to redirect to the proper domain under https. For example, I would like the script to redirect from:

 

http://dumbquestion.com to https://www.dumbquestion.com

 

or https://dumbquestion.com to https://www.dumbquestion.com

 

 

Thanks in advance for any help,

 

JG

 

1 Reply

  • Try:

    
    when HTTP_REQUEST {
      if { [matchclass [string tolower [HTTP::uri]] starts_with $::Intranet_Require_SSL] } {
        HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
      }
    }