Forum Discussion
Misty_Spillers
Nimbostratus
Feb 28, 2012Redirecting 404 to a friendly page by uri
I have done lots of searching and have even come across posts of exactly what I want to do but is doesn't seem to work for me. I'm wondering if I'm running into a problem because I'm running 9.4.4 but...
Misty_Spillers
Nimbostratus
Feb 29, 2012I'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++)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
