how to create maintenance page with tuckey rewriting

29 views
Skip to first unread message

Rewriter

unread,
Jun 8, 2015, 1:20:34 PM6/8/15
to urlre...@googlegroups.com
Hello,

Would like to prepare a maintenance page for a tomcat webserver via tuckey rewriting rules.
How to convert this into a tuckey rewrite rule?

This is the general setup of an existing apache example i would like to use. 

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !AAA.BBB.CCC.DDD
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html

What this does is...
turn on the rewrite engine
don't match your workstation or office IP address. (An exclusion so you can see the actual site, optional)
make sure the maintenance page exists
check for the .enable file. This is how you turn the holding page on and off. So that a service restart is not needed
don't apply the rule when serving the maintenance page (avoids circular rewrites)
Then the rule itself...

thanks Rewriter. 
Reply all
Reply to author
Forward
0 new messages