How to define the 404 error page

Source: Internet
Author: User
Tags blank page

The method is as follows:

Create an HTML file for your 404 page. This may be anything you want. It may be that 404 is just a blank page. It can also be your layout, including 404 words. It all depends on your wishes.

Save the file in any file format you want (HTML, PHP, etc.) and upload it to your webpage. You can create a sub-folder at any time in your main or root directory. If you only need one (404), I suggest you only stay in your root folder.

Press Start> run and enter notepad (on Mac, you only need to open a text editor). Now, you will use the following code and include it in your text editor:

ErrorDocument 404

Http://www.yoursite.com/404.htm

Remember, for the changed URL, the above code path page 404 is on your server.

Now the file "> save as" htaccess.txt | save location, you will remember.

Upload the HTACCESS. TXT folder to your webpage. (Make sure it is in the home or root directory)

Rename the file (different FTP clients.HTACCESS(Make sure there is a ". "HTACCESS and nitric oxide. After "text"HTACCESS)

Come with you! You should have a good way to go. There are other error pages, such as internal errors and prohibitions; search for Google these pages, and then it is just a matter of time to add that the code goes to your. Htaccess file, and the file is wrong again (such as your 404 page ).

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.