Custom 404 error issues with Apache - the ErrorDocument is 404 as well

后端 未结 4 620
自闭症患者
自闭症患者 2020-12-03 04:51

I am trying to create a custom 404 error for my website. I am testing this out using XAMPP on Windows.

My directory structure is as follows:

error\\4         


        
4条回答
  •  盖世英雄少女心
    2020-12-03 05:24

    The ErrorDocument directive, when supplied a local URL path, expects the path to be fully qualified from the DocumentRoot. In your case, this means that the actual path to the ErrorDocument is

    ErrorDocument 404 /JinPortfolio/error/404page.html
    

    When you corrected it in your second try, the reason you see that page instead is because http://localhost/error/404page.html doesn't exist, hence the bit about there being a 404 error in locating the error handling document.

提交回复
热议问题