Forum Discussion
hooleylist
Nov 17, 2008Cirrostratus
The URI will always start with a leading forward slash. If you need to remove this when using the URI in the redirect, you can use 'string trimleft' (Click here😞
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New request to : [HTTP::uri]"
switch -glob [HTTP::path] {
"/" { HTTP::path "/member" }
"/member/*" -
"/tooljournals*" { do nothing }
"/eb-member-earAdmin" -
"/admin" -
"/adminTool" {
HTTP::respond 404 content "\
RESOURCE NOT FOUND"
}
default {
HTTP::uri "/member/?cid=[string trimleft [HTTP::uri] /]"
}
}
}
when HTTP_REQUEST priority 501 {
Log a debug statement in a rule event with a different priority so the HTTP::uri value isn't cached.
This event can be removed after testing.
log local0. "[IP::client_addr]:[TCP::client_port]: Modified URI: [HTTP::uri]"
}
Aaron