How to enable apache to support. htaccess and set the 404 error page

Source: Internet
Author: User

How to make apache support. htaccess, a problem I found when I checked seo optimization today, that is, defining the 404 error of the page has some benefits for website optimization, so I also need to set the page that cannot be found on my host. Below is my experience today.

Step 1: Find the httpd. cof file in the apache installation directory and find

<Directory/>
Options FollowSymLinks
    AllowOverride none
</Directory>
We only need to change the none of the blue words to all and restart apache,

Step 2: Now we need to transfer the content that cannot be found on my website to the 404 page I specified, so we need to write it. htaccess document, which cannot be created in windows without the main file name. I found the file previously modified from lx.

ErrorDocument 404/index. php

It is okay to add this sentence, but it is best not to transfer it to the homepage.

After writing, this site is original:, reprinted please note: www.111cn.net

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.