Strange Behavior With Maintenance Page Redirect iRule
Hello,
I've been asked to redirect several websites, all of which are subdomains of a domain (ie. x.site.com, y.site.com, and z.site.com), to a maintenance page when we perform maintenance in the future. All of the sites need to be directed to the same maintenance page so I thought I could create 1 iRule and apply it to the different virtual servers for each subdomain.
I created the following rule:
when HTTP_REQUEST { set host [HTTP::host] if {$host contains ".site.com"}{ HTTP::respond 302 Location "www.site.com/c/site-down/site-down.php" } }
I applied the rule to a test virtual server and tested it and am seeing strange behavior.
Firefox throw's the following error:
The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This is what is showing up as the redirected URL, a long string of repeated domain name/path. http://x.site.com/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/www.site.com/c/site-down/site-down.php
The iRule appears to be pretty straightforward and I'm not sure what is causing this behavior. Am I doing something wrong?
Please help!
Thanks,
Rich