相关疑难解决方法(0)

为什么我的PHP应用程序不会发送404错误?

if (strstr($_SERVER['REQUEST_URI'],'index.php')) {
    header('HTTP/1.0 404 Not Found');
}
Run Code Online (Sandbox Code Playgroud)

为什么不这样做?我得到一个空白页面.

php header http-status-code-404

141
推荐指数
6
解决办法
14万
查看次数

PHP 标头 HTTP 1.0 与 1.1

可能重复:
404 标头 - HTTP 1.0 或 1.1?

你应该使用

header( "HTTP/1.0 404 Not Found", true, 404 );
Run Code Online (Sandbox Code Playgroud)

代替

header( "HTTP/1.1 404 Not Found", true, 404 );
Run Code Online (Sandbox Code Playgroud)

当用户代理使用 HTTP/1.0 时?也就是说,用相同的HTTP版本回复好不好?

顺便说一句,我用它来声明当前未登录的用户不存在页面。我知道它是不同的版本,并且 HTTP/1.1 有不同的功能。

php header http http-headers

5
推荐指数
1
解决办法
4812
查看次数

标签 统计

header ×2

php ×2

http ×1

http-headers ×1

http-status-code-404 ×1