Forum Discussion

Joe_Pipitone's avatar
Joe_Pipitone
Icon for Nimbostratus rankNimbostratus
Jun 15, 2009

Add additional hostnames to this rule

I have put the following iRule in place, however I need to search for other subdomains in the hostname besides portals, such as www and strip them out and keep the rest of the URI. How easy is this given the following iRule?

 

 

when HTTP_REQUEST {

 

switch [string tolower [HTTP::host]] {

 

"portals.sitename.com" {

 

set host "sitename.com"

 

set uri [string map -nocase {"/path_to_replace" "/new_path" "index.jsp" "index.asp"} [HTTP::uri]]

 

HTTP::redirect http://$host$uri

 

}

 

}

 

}

 

 

I simply want to add another statement, do I just add a case statement under the switch and add additional subdomains?

 

 

Thanks for any help!