Forum Discussion
Eric_St__John
Feb 01, 2014Employee
Your irule will redirect ALL requests to /maintenance.html, including requests for /maintenance.html if this is irule is redirecting back to the same virtual server. You have to bypass the redirect for requests that are coming in for /maintenance.html(or any other objects that you don't want redirected. The rule below will redirect all requests, except requests for /maintenance.html, to https://abc.com/maintenance.html This may not accomplish everything you desire, as there may be other objects on the page that you also have to bypass the redirect for.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/maintenance.html" {
}
default {
HTTP::redirect "https://abc.com/maintenance.html"
}
}
The following would redirect for everything except /maintenance.html, /image1.png, and image2.png
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/maintenance.html" -
"/image1.png" -
"/image2.png" {
}
default {
HTTP::redirect "https://abc.com/maintenance.html"
}
}
Eric