Forum Discussion
iFile maintenance page issue with longer paths
Hi Jani,
I stringly recommend you to not use a 200OK for every response send to your site. It will pretty much hurt your existing SEO ratings...
Its far more elegant to tell your clients (and also search engines) that the site is currently not available by 407 - Temporary Redirect to a given Maintenante-Page which is then served using a 503 - Service Unavailable status code.
when HTTP_REQUEST {
if { [active_members Pool-X] < 1 } then {
switch -exact -- [HTTP::uri] {
"/image.png" {
HTTP::respond 503 content [ifile get "image.png"] "Content-Type" "image/png"
}
"/maintenance.html" {
HTTP::respond 503 content [ifile get "maintenance_page"] "Content-Type" "text/html"
}
default {
HTTP::respond 407 Location "/maintenance.html"
}
}
}
}
Note: For further information how to handle Maintenance Pages the right way, please check out https://plus.google.com/+PierreFar/posts/Gas8vjZ5fmB
Note: To make the image load in your current iRule example, you may review your HTML and make sure the image file is referenced via "/image.png" (absolute to root web) instead of using just "image.png" (relative to the current web folder). I'm pretty much sure this would fix your original iRule and problem...
Cheers, Kai
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