How does a PHP website prevent important server information from being displayed when the file behind the website does not exist?

Source: Internet
Author: User
When a PHP website does not display important server information such as & nbsp; http: // & nbsp; url & nbsp;/abc. asp & nbsp; If this file does not exist, the error page shown in figure (image 1) is displayed. However, the error information may leak server-related information, how can I prevent him from displaying this interface, or, when an error occurs, when the PHP website directly causes the file after the website to not exist, it will not display important server information
For example, http: // URL/abc. asp. If this file does not exist,
The error page shown in Figure 1 is displayed ),

However, an error message may expose server-related information. how can I prevent this interface from appearing? or, when an error occurs, a prompt is displayed (image 2)


------ Best solution --------------------
Specify error handling page 404

Modify IIS in IIS Manager
Apache ErrorDocument 404/404 .php in the configuration file
------ Other solutions --------------------
Unfortunately, the editor reversed my images. The one above is (image 2), and the one below is (image 1 ).
------ Other solutions --------------------

Thank you very much for your support ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.