如何返回特定HTTP状态code在一个普通的HTML页面 [英] How to Return Specific HTTP Status Code in a Plain HTML Page

查看:263
本文介绍了如何返回特定HTTP状态code在一个普通的HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网站暂时无法访问谷歌建议返回一个503 HTTP响应。

Google recommends returning a 503 HTTP response when a site is temporarily unavailable.

我有几个纯HTML站点。如何在普通的HTML网站返回503状态?

I have a few plain HTML Sites. How do I return 503 status in plain HTML sites?

我在Linux中使用Apache。

I'm on a Linux box with Apache.

推荐答案

您必须设置断绝状态code,而不是在你的HTML文件。

You have to set the status code on the sever and not in your HTML files.

这篇关于如何返回特定HTTP状态code在一个普通的HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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