Redirect to Somewhere when Response 4xx or 5xx

  • When server response 4xx or 5xx, then redirect(aka:302) to somewhere.

Requirement

  • Service Type: HTTP / HTTPS

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"
  }
}
a10/slb/aflex/http/error-redirect.txt · 上一次變更: 2014/04/24 15:53 由 jal
上一頁 | 下一頁 | 回首頁 | RSS Feed | Facebook