Forum Discussion
Misty_Spillers
Feb 29, 2012Nimbostratus
I'm always so nervous posting my newbie questions here and I'm always smiling at the at results, Thanks for all the help. One last question and I'll try to answer it myself. I think you did pretty much answer it in the log example I just want to make sure its the right way to do this. Also if the statement is in the right place.
Scenario 3: Big boss says "we are doing this for the agencies, why can't we return a generic moved.html for anything that doesn't match /agency1 and /agency2?"
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"
}
default {
HTTP::respond 301 \
"Location" "http://www.main.com/moved.html" \
"Server" "www.main.com"
}
}
}
}
}
It that right?
(sorry the format is a little silly, it never lets me copy/paste from notepad++)