Catch www and domain

I have an iRule that tries to catch both a uri as well as a hostname, however it doesn’t seem to want to catch the www.domainname.com, it only catches it without the www.

I tried using a wildcard (*) in front of the domainname.com, however it just triggers an error.

Anyone know what I may be missing? Here’s the rule:

when HTTP_REQUEST {
        if {[HTTP::uri] starts_with "/presentations" } {
         HTTP::redirect "http://someaddress.com/download.aspx"
      } elseif {[string tolower [HTTP::host]] eq "domainname.com"}{
        HTTP::redirect "http://someaddress.com/events/home.aspx"
      }
     }

Thanks

Scratch that - I resolved this by using a multi host switch statement.