Forum Discussion

TJ_Vreugdenhil's avatar
Jun 14, 2015

Cisco ACE to F5 - Adding WWW

Does the following Cisco ACE config:

policy-map type loadbalance first-match wsredirect-l7
class-map type http loadbalance match-any no-www-redirect-l7
  2 match http header Host header-value "[^www\.]..*\...*"

  rserver redirect no-www-redirect
  webhost-redirection http://www.%h%p 302
  inservice

convert to the following F5 iRule config?

when HTTP_REQUEST {
     if {![string tolower [HTTP::host]] contains "www." } {
      HTTP::redirect "http://www.[HTTP::host][HTTP::uri]"
       log local0. "Add in "www" if not present and use a 302 response"
    }
}

(We are redirecting back to HTTP to do additional redirects).

Thanks!