Forum Discussion

Austin_Geraci's avatar
Aug 17, 2010

matchclass, code okay, and would you do this differently?

Okay so I'm looking to redirect requests to mydomain.com and http://www.mydomain.com/ to https://www.mydomain.com/secure, if no matches load balance to the pool specified in the VS.

 

 

Is this code okay and or would you guys/gals do this any differently?

 

 


 when HTTP_REQUEST {
     set host [matchclass [string tolower [HTTP::host]] $::myclass " "]
 Check if there was a match
if {$host ne ""}{   
     HTTP::respond 301 Location "https://www.mydomain.com/secure"
} else {
       pool "mysecurepool_443"
  }
    }

12 Replies