Home  >  Article  >  Backend Development  >  PHP网站怎么让网址后面的文件不存在时,不让显示服务器方面的重要信息

PHP网站怎么让网址后面的文件不存在时,不让显示服务器方面的重要信息

WBOY
WBOYOriginal
2016-06-13 13:04:10794browse

PHP网站如何让网址后面的文件不存在时,不让显示服务器方面的重要信息
比如 http:// 网址 /abc.asp 如果这个文件不存在,
就会显示如下图所示的出错界面(图片一),

但是出错信息中,会泄露服务器方面的相关信息,如何不让他出现这个界面,或者,出错时,直接提示(图片二)


------最佳解决方案--------------------
指定 404 错误处理页

IIS 在 IIS 管理器中修改
apache 在配置文件中 ErrorDocument 404 /404.php
------其他解决方案--------------------
可惜,编辑器把我滴图片给弄反了。上面那一张是(图片二),下面那一张是(图片一)。
------其他解决方案--------------------

非常感谢唠叨大哥的热心帮忙~

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn