Forum Discussion
question regardaing Irule
Hi All
Maintenance page is hosted in server.When type in https://abc.com i am getting maintenance page . However Acessing https://abc.com/*,its not redirecting to the Maintenance page .
For example Typing https://abc.com/test ,i am getting page not found.
How to include for check for ANY string in HTTP URI so that able to redirect to Maintenance page
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/ "} {
HTTP::redirect "https://maintenancepage.com"
} }
Kindly suggest to resolve this
Thanks
1 Reply
Hi,
Here a typical example. I added some more code to show you how switch works and also the use of HTTP::respond as an alternative to HTTP::redirect :
when HTTP_REQUEST { switch -glob [HTTP::path] { "/test" { HTTP::redirect "https://test.com" } "/*" { HTTP::redirect "https://maintenancepage.com" } "/" { HTTP::respond 302 noserver "Location" "https://maintenacepage.com" "Cache-Control" "no-cache, must-revalidate" } } }
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