是“404重定向”是否为“404重定向”。合法的重定向? [英] Is a "404 redirect" a legitimate redirect?
问题描述
我的情况是某些用户可能会出现错误的页面,链接等。在大多数情况下,我可以确定应该显示的正确页面,因此我想重定向到正确的URL。
I have a situation where some users may come to mistyped pages, from links, etc. In most situations I can determine the correct page that should be displayed, so I want to redirect to the correct URL.
在这种情况下,301重定向是否合适。 301表示永久移动,但在这种情况下,文档首先不在那里。是否合法设置404 Not Found标头,然后重定向到正确的URL?
Is a 301 Redirect appropriate in this case. 301 means "Moved Permanently", but in this case the document wasn't there in the first place. Is it legitimate to set a 404 Not Found header, then redirect to the correct URL?
推荐答案
我使用301. Moved永久是恰当的,因为它告诉被访问的页面不在那里,永远不会。如果有人有该页面的链接,他们就会知道他们应该更新链接。
I'd use 301. Moved permanently is appropriate in that it tells the accessed page is not there and never will be. If someone has a link to that page, they then know they should update the link.
这篇关于是“404重定向”是否为“404重定向”。合法的重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!