Forum Discussion
Wil_Schultz_101
Feb 28, 2012Nimbostratus
I try to stay away from if statements, no good excuse other than switches are sometimes faster.
Try this, it should do the trick for you.
when HTTP_REQUEST {
set path [string tolower [HTTP::path]]
}
when HTTP_RESPONSE {
switch [HTTP::status] {
"404" {
switch -glob $path {
"/agency1" {
HTTP::respond 301 \
"Location" "http://www.main.com/agency1/moved.html" \
"Server" "www.main.com"
}
}
}
}
}