Soumik mahato
Soumik mahato

Reputation: 63

Xampp Error "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Hi I am trying out apache htaccess for my site(not wordpress). I want to make custom 404 error so I add following in .htaccess file:

ErrorDocument 404 /404.php

My file structure is

/htdocs
       /some-dir
                /.htaccess
                /404.php

while I accessing any random URL I get the error:

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Upvotes: 0

Views: 1521

Answers (1)

MrWhite
MrWhite

Reputation: 45948

ErrorDocument 404 /404.php

The ErrorDocument directive takes a document root-relative URL-path, so from your file structure this should presumably be:

ErrorDocument 404 /some-dir/404.php

Reference:

Upvotes: 1

Related Questions