create an httpclass


i am trying to create an httpclass using tmsh, but am having trouble with the "glob" or "regex" to express a wildcard.

If I was in the GUI, I would create a new HTTPclass, click the checkbox to match on ANY host, then redirect to "www"


so, a user who typed   "" would get redirected to ""


Here is what I have so far with the tmsh:

 create ltm profile httpclass httpclass_www-redirect hosts add {glob: "*"} ....


3 Answer(s):

Hi Michelle,

I have not been doing F5 for long, but I think this is done with an Irule applied to the Virtual Server

   if { [HTTP::host] starts_with "" } { 

I dont know how to do this exact syntax with tmsh, but I think to do a redirect you need an Irule and apply this to the VS

I just created one in the GUI and here's how it looks in tmsh;

ltm profile httpclass test {
    app-service none
    cookies none
    defaults-from httpclass
    headers none
    hosts { }
    paths none
    pool none
Note, if you wanted to match all hosts it would be 'hosts none' (funnily enough) but you don't want to match or your users will be stuck in an endless redirection loop.

Your answer: