Forum Discussion

Jon_Singh's avatar
Jon_Singh
Icon for Altostratus rankAltostratus
Jul 12, 2019

Direct all URI's back to only the host

Trying to direct all URI's back to host, can I do something like this?

when HTTP_REQUEST {
   if ([HTTP::uri] == * ) }{
   HTTP::redirect http://website.com
   }
}   

1 Reply

  • You can. But this have some side effects. It shows only root page without jpegs, css, js files unless you do them inline. the correct version of the iRule:

    when HTTP_REQUEST {
       if { not ( [HTTP::uri] eq "/" ) }{
       HTTP::redirect http://website.com
       }
    }