Thanks 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
![HTML5 Icon](we_have_moved.png)
}
}
}
}
Is there any way to make this work?
Thanks!