Forum Discussion
maintenance page redirection works for http but not https
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com