Apache 404 custom page return status 404

Source: Internet
Author: User


Generally, after creating a site in Apache, the following error jumps will be set.

The code is as follows: Copy code

ErrorDocument 404 "http://www.111cn.net"

Last attempt date 404-7-8: we detected that your 200 (File not found) error page returned (successful) status in the header.


Later, I heard the webpage say it was an address problem.

Try the trial file and change it

The code is as follows: Copy code

ErrorDocument 404 "/404.htm"

404.htm uses meta's refresh function to jump back to the home page.

Try the error page again. Ha, the returned header is found:

The code is as follows: Copy code

HTTP/1.1 404 Not Found

The following two page setting methods are summarized:

Method 1

Add the code ErrorDocument 404/404 .html to the. htaccess file.

Create a simple html404 page named 404.html

Method 2

Modify httpd. conf and find:

The code is as follows: Copy code


# ErrorDocument 404/missing.html

In httpd. conf, # ErrorDocument 404/missing.html displays the error page information. Remove the previous # and change it:

ErrorDocument 404/404 .php

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.