TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to Return 503 Service Unavailable or other specific HTTP Status Code

3 点作者 sathishmanohar超过 13 年前

1 comment

adamrmcd超过 13 年前
The Apache example is incomplete. For me, I used Chrome to "download the strike page" from <a href="http://sopastrike.com/strike/" rel="nofollow">http://sopastrike.com/strike/</a> and saved it on my server as /strike.html. Then, I added the following to my .htaccess:<p><pre><code> RewriteEngine on RewriteCond %{REQUEST_URI} !strike.html RewriteCond %{REQUEST_URI} !^/strike_files/ RewriteRule (.*) /strike.html [R=503,L] ErrorDocument 503 /strike.html </code></pre> This will trigger 503 for every page request but /strike.html and its subdirectory, also Apache will serve the strike page content for browsers in place of any status codes 200 or 302 on the original request url.
评论 #3478326 未加载