Forum Discussion
Juerg_Wiesmann
Jan 05, 2009Nimbostratus
when HTTP_REQUEST {
if {[HTTP::cookie exists "User-Name"] }{
if {[HTTP::uri] ends_with "index_out.html" }{
log local0. "URI is [HTTP::uri]"
pool my_web}
if {[HTTP::uri] ends_with "loginForm.jsp" }{
pool my_web}
if {[HTTP::uri] ends_with ".gif"}{
pool my_web}
}
elseif {[HTTP::uri] contains "xyz"}{
HTTP::redirect "https://[HTTP::host]/index_out.html"
log local0. "Redirect1 is https://[HTTP::host]/index_out.html"
}
else {
HTTP::redirect "https://[HTTP::host]/index_out.html"
log local0. "Redirect2 is https://[HTTP::host]/index_out.html"
}
}
or you could use
when HTTP_REQUEST {
if {[HTTP::cookie exists "User-Name"] }{
if {[HTTP::uri] ends_with "index_out.html" or [HTTP::uri] ends_with "loginForm.jsp" or [HTTP::path] ends_with ".gif"} {
log local0. "URI is [HTTP::uri]"
pool my_web}
}
elseif {[HTTP::uri] contains "xyz"}{
HTTP::redirect "https://[HTTP::host]/index_out.html"
log local0. "Redirect1 is https://[HTTP::host]/index_out.html"
}
else {
HTTP::redirect "https://[HTTP::host]/index_out.html"
log local0. "Redirect2 is https://[HTTP::host]/index_out.html"
}
}
or even simpler
when HTTP_REQUEST {
if {[HTTP::cookie exists "User-Name"] }{
if {[HTTP::uri] ends_with "index_out.html" or [HTTP::uri] ends_with "loginForm.jsp" or [HTTP::path] ends_with ".gif"} {
pool my_web}
}
else {
HTTP::redirect "https://[HTTP::host]/index_out.html"
}
}