如何将Apache网站放到503“暂时关闭”? [英] How to put Apache website to 503 "temporary down"?

查看:354
本文介绍了如何将Apache网站放到503“暂时关闭”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RFC2616,503服务不可用

RFC2616, 503 Service Unavailable


由于临时超载或维护,服务器当前无法处理请求服务器

如何配置Apache 2.2以使用自定义HTML页面提供基于特定名称的虚拟主机503代码?

How to configure Apache 2.2 to serve particular name based virtualhost 503 code with custom HTML page?

推荐答案

您可以使用 mod_rewrite

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteRule !^/down/for/maintenance$ %{DOCUMENT_ROOT}down/for/maintenance [L,R=503]

RewriteCond 指令确保在重定向到自定义错误文档时不会发生其他内部错误。

The RewriteCond directive makes sure that no additional internal error occurs when redirecting to a custom error document.

这篇关于如何将Apache网站放到503“暂时关闭”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆