drju37335 2018-01-03 15:57
浏览 38
已采纳

找不到标题404 - 在Firefox 57.0.3(64b)中无法使用\ on \

<?php
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");

No output on\in page.


why is that? and what to do to see the error page? path to 404.php-script

no output in firefox


reply to the first comment

reply to the first comment

  • 写回答

1条回答 默认 最新

  • doucheyi1347 2018-01-03 16:38
    关注

    You're not seeing any output because you haven't created any. The body of a 404 not found page isn't magically created for you simply by throwing a 404. If you want a nice-looking "Not Found" page, you have to actually build it. (Or tell your web server where to find it.) Note that the header value is what makes a 404 page. The content of (or even the presence of) the body is irrelevant.

    In your second example, the page is generated by Apache because it couldn't find the requested file. In your first example, the file was found, and executed, and it generated no output.

    If you want to design a nice custom 404 page, you can put your pretty content into this file, and then set it to be the default error handler for your whole site by using ErrorDocument 404 /404.php in your Apache config. Then, whenever you request a page that doesn't exist, you'll get this page instead.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型