维护页面重定向的正确状态代码? [英] Proper status code for a maintenance page redirect?

查看:146
本文介绍了维护页面重定向的正确状态代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行即将进行的维护时,我将不得不将所有网站流量重定向到维护页面。用于重定向的正确状态代码是什么?

While performing some upcoming maintenance, I'm going to have to redirect all site traffic to a maintenance page briefly. What's the proper status code to use for the redirect?

503有意义,但从技术上讲,它不是重定向状态。 302是一个临时重定向,但想知道如果当时该网站被蜘蛛侠可能会产生影响。

503 makes sense, but it's not technically a redirection status. 302 is a temp redirect, but wondering if that might have implications if the site is being spidered at the time.

推荐答案

我会使用503,结合Retry-After标头。一个合适的机器人应该知道如何处理这个问题。

I would use 503, too, combined with a Retry-After header. A proper robot should know how to handle this.

这篇关于维护页面重定向的正确状态代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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