目錄表

Redirect to Somewhere when Response 4xx or 5xx

Requirement

Code

when HTTP_RESPONSE {
  if { [HTTP::status] starts_with "2" || [HTTP::status] starts_with "3"} {
    # Just fast pass that to decrease process
  } elseif { [HTTP::status] contains "404"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "403"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "402"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "400"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "500"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "501"} {
    HTTP::redirect "http://www.au.edu.tw"
  } elseif { [HTTP::status] contains "503"} {
    HTTP::redirect "http://www.au.edu.tw"
  }
}