Forum Discussion
Wil_Schultz_101
Feb 29, 2012Nimbostratus
You can easily add another clause to the switch.
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"
}
"/agency2*" {
HTTP::respond 301 \
"Location" "http://www.main.com/agency2/moved.html" \
"Server" "www.main.com"
}
}
}
}
}