Brandon_11574
Mar 27, 2011Nimbostratus
Special 404 Redirect Rules
We have some sub folders in our site that we want special 404 handling. If there are any 404 errors on any file found under that folder or any of its children folders, we want to employ this 404 handling. This can easily be done with something like the following:
if { ([HTTP::status] contains "404") or ([HTTP::status] contains "400")} {
if { [HTTP::uri] starts_with "/$subFolder/" } {
HTTP::redirect http://domain.com/$subFolder/specialPage.aspx
}
}
But here's my dilemma. I have over 500 different sub folders that need to have this rule applied to. Is there a way to store the sub folder list into an array or similar type variable? We would like to simply maintain the 'array' and not worry about writing a large number of if statements. Or does anyone have a good way for us to comply with this 'requirement' with reasonably maintainable code?