Using .htaccess for 404 error

I use .htaccess in my project, I just use the following code

ErrorDocument 404 / 404.php

in .htaccess inside the root folder, but it does not redirect 404.php when trying to open a webpage with an error.

I want to know if there is a syntax error in the .htaccess file.

I used the .html file instead of the .php file. but it causes the same error.


Not found

The requested URL / ht / re was not found on this server.

In addition, when trying to use ErrorDocument to process a request, a 404 Not Found error was detected.

+3
source share
1 answer

you must first find your error page

i.e. on the local server my 404.php in the root / error, then

ErrorDocument 404 / error / 404.php

-

404.php, 404.php

+2

All Articles