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.

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

报告相同问题?

悬赏问题

  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 qgcomp混合物线性模型分析的代码出现错误:Model aliasing occurred
  • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥15 小红薯封设备能解决的来
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答