Forum Discussion
hooleylist
Jun 14, 2007Cirrostratus
I assume you just want to redirect based on the URI in the request and not the host. Here's an example that will send a redirect for / to /cda/homepage.do. All other requests will be unchanged.
when HTTP_REQUEST {
if {[HTTP::path] eq "/"}{
log local0. "redirecting client [IP::client_addr]"
HTTP::redirect http://[HTTP::host]/cda/homepage.do
}
}
If you have more tests you want to perform, you could use a switch statement to do the comparisons. Check the wiki page for switch (Click here) for details.
Also, if you're on version 9.4.0, you can use an HTTP class to issue redirects. Create an HTTP class with a path of "/" and change the 'send to' option to 'redirect to' http://[HTTP::host]/cda/homepage.do.
Holler if you have any questions.
Aaron