RFC2616, 503 服务不可用
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server
如何配置 Apache 2.2 以使用自定义 HTML 页面提供基于特定名称的虚拟主机 503 代码?
最佳答案
503 Temporarily Unavailable, with trigger
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteCond "/srv/www/example.com/maintenance.trigger" -f
RewriteRule ^(.*)$ /$1 [R=503,L]
如果 maintenance.trigger
文件存在,Apache 将提供一个 503 Service Unavailable
响应。要提供自定义的“停机维护”页面,请使用 ErrorDocument
指定文件,如下所示:
ErrorDocument 503 /503_with_cats.html
尽情享受吧!
关于apache - 如何将 Apache 网站设置为 503 "temporary down"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/622466/