Forum Discussion
6 Replies
- Eric_St__JohnEmployee
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
- saravana01_1405Nimbostratus
Awesome, it works perfectly now... Thank you again for your help...
- saravana01_1405Nimbostratus
Hi, I still have issue for displaying the company image, it doesn't display image on the webpage but everything else appears over http and https request. This is the irule i mapped to https VIP pool.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/maintenance.html" - "/images/abcLogo.png" { } default { HTTP::redirect "https://abc.com/maintenance.html" } } }
- Mike_61663Cirrus
What does the IMG reference in the HTML on maintenance.html look like?
If this is the case, the simplest work-around is to change the IMG SRC link in the HTML to be relative "/images/abcLogo.png".
- saravana01_1405Nimbostratus
Thanks Mike for your reply, the Image reference URL is - https://abc.com/images/abcLogo.png maintenance URL is - https://abc.com/maintenance.html
let me know if you need any more details..
- Mike_61663Cirrus
Ahh, just noticed that you're converting the HTTP path to lowercase and then comparing it to "/images/abcLogo.png" which contains uppercase characters. That's not going to ever match! Just change that second switch condition to "/images/abclogo.png" (i.e. change the uppercase "L" to a lowercase "l")