Forum Discussion
Aug 28, 2013
A couple of problems.
1) You are not adding the protocol in the Location header so the browser is thinking it's a relative link and thus appending it to the new URL.
2) If your iRule is on www.site.com, the redirect is going back through the iRule which is then issuing another redirect - thus the firefox infinite loop error.
You might try something like this
when HTTP_REQUEST {
Check host for potential redirect
if { [HTTP::host] contains ".site.com" } {
Avoid recursive redirects
if { ! ([HTTP::uri] ends_with "/site-down.php") } {
HTTP::redirect does a 302 redirect for you.
HTTP::redirect "http://www.site.com/c/site-down/site-down.php"
}
}
}
Hope this helps...
-Joe