404-header ("http/1.1404 notfound"); why not jump? (PHP)

Source: Internet
Author: User
As far as I know, add the following sentence to the. htaccess or apache config file: ErrorDocument404missing.html (note: After I have created this file, this missing.html page will appear when we input a nonexistent URL. Then I tried again. in te... as far as I know, add the following sentence to the. htaccess or apache config file:
ErrorDocument 404 /missing.html(Note: I have created this file)
That is why this missing.html page appears when we enter an nonexistent URL.
Then I tried again and wrote the following code in test. php:


  

The missing.html page is not displayed.
So I want to ask, how can I display it?
Or, is it wrong for me to write this? Why?
Actuallyheader('HTTP/1.1 404 Not Found');What is the purpose?

Beginner in PHP. hope you can give me some advice. thank you!

Reply content:

As far as I know, add the following sentence to the. htaccess or apache config file:
ErrorDocument 404 /missing.html(Note: I have created this file)
That is why this missing.html page appears when we enter an nonexistent URL.
Then I tried again and wrote the following code in test. php:


  

The missing.html page is not displayed.
So I want to ask, how can I display it?
Or, is it wrong for me to write this? Why?
Actuallyheader('HTTP/1.1 404 Not Found');What is the purpose?

Beginner in PHP. hope you can give me some advice. thank you!

HTTP status code: http://baike.sogou.com/v78674...

In Apache configuration, ErrorDocument displays the corresponding error status information on a page rather than redirection. Use 302,301 or JS, HTML meta refresh for redirect

Web server configuration

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.