Forum Discussion
FMA
Nimbostratus
Nov 10, 2016Old story - maintenance page iRule
Hello,
I know this topic has been discussed many times already but there is one thing I got stuck with - is it possible to combine two of these actions into a single iRule? :
when HTTP_REQUEST {...
FMA
Nimbostratus
Nov 11, 2016Thanks David! It really helped me to get into this. Just one more thing here - I'm trying to use a variable below (REDIRECTURL) to simplify future modifications, but when I try to use it within HTTP:respond code it doesn't return variable value and just prints it as a text "$REDIRECTURL".
when HTTP_REQUEST {
set REDIRECTURL "https://example.com"
switch [HTTP::uri] {
"/we_have_moved.png" {
HTTP::respond 200 content [ifile get we_have_moved.png] "Content-Type" "image/gif"
}
default {
HTTP::respond 200 content {
The site has been moved
The webiste has moved to
Please update your bookmarks!
You will be redirected in
50 seconds

}
}
}
}
Is there any way to make this work?
Thanks!
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects