Forum Discussion
hooleylist
Apr 13, 2012Cirrostratus
Hi,
I think this should work to strip off the first directory for URIs starting with /foo/. HTTP::path will allow you to rewrite the path as opposed to HTTP::redirect which sends a 302 redirect and updates the URL the client sees.
when HTTP_REQUEST {
Check the HTTP path with wildcards
switch -glob -- [HTTP::path] {
"/foo/*" {
Remove /foo from the path by skipping one character and matching after the next /
HTTP::path [findstr [HTTP::path] / 1]
}
}
}
Aaron