Forum Discussion

katekattar_4936's avatar
katekattar_4936
Icon for Nimbostratus rankNimbostratus
Mar 04, 2009

Simple append uri irule

Hi, I need to create a fairly simple irule but am having trouble. Essentially I need to append a different uri depending on the host. Eg.

 

www.lsc.co.uk should go to www.lsc.co.uk/pdg/lsc

 

www.lsc.com should go to www.lsc.co.uk/pdg/lsc

 

www.abc.co.uk should go to www.abc.co.uk/pdg/abc

 

 

I have tried this, but am getting a syntax error. What is the best way to do this irule?

 

 

when HTTP_REQUEST {

 

if {[HTTP::host] eq "www.londonsportscare.co.uk"} && {[HTTP::uri] eq "/"} {

 

HTTP::redirect "http://[HTTP::host]/pdg/london-sports-care"

 

}

 

}

 

 

Kind Regards

 

Kate

 

 

1 Reply

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    You're on the right track if you want redirects, but might you really want URI re-writing?

     

     

    Redirect: client gets new URI, re-sends new request

     

    Rewrite: LTM tranlates URI inline, server recvs the original request w/the URI re-written

     

     

    /d