我正在编写一个网站,我想知道最好的选择.
我应该在header("HTTP/1.0 404 Not Found")不重定向的情况下添加,还是应该重定向并添加404标头?
header("HTTP/1.0 404 Not Found")
php http-status-code-404
我有一种情况,一些用户可能会来错误的页面,链接等.在大多数情况下,我可以确定应该显示的正确页面,所以我想重定向到正确的URL.
在这种情况下,301重定向是否合适.301表示"永久移动",但在这种情况下,文档首先不在那里.设置404 Not Found标头,然后重定向到正确的URL是否合法?
redirect http http-status-code-404 http-status-code-301
http-status-code-404 ×2
http ×1
http-status-code-301 ×1
php ×1
redirect ×1