<?php
ob_start();
//返回503状态码
header(HTTP/1.1 503 Service Temporarily Unavailable);
header(Status: 503 Service Temporarily Unavailable);
//让搜索引擎蜘蛛指定的时间再来爬取网站
//header(Retry-After: Wed, 24 May 2017 18:00:00 GMT);
//让搜索引擎蜘蛛等10分钟再来爬取网站默认单位秒
header(Retry-After: 600);
?>
<!DOCTYPEHTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>503</title>
</head>
<body>
<h1>网站维护</h1>
</body>
</html>
(3)设置Nginx rewrite规则,将所有页面302临时跳转到503.php
rewrite ^(.*)$ /503.php redirect;
网站503错误标准姿势
最新推荐文章于 2024-07-01 10:34:24 发布