Hello, what is the web program you are using? I tested nginx, regardless of whether the directory or the file does not exist, it returns a 404 error. The file is not found.
It doesn't always show Error 404.
aaPanel_Kern apache 2.4
Hello, apache will return 403 error if the directory does not exist. Show Permission issue
The file does not exist will return a 404 error
To better understand me, I'm leaving you with a img.
In the picture above you can see that I don't get a 404 error, but only a "File not found" message, although I should get an Error 404.
Below I leave another image where I get a 404 error because it is a folder and not a file.
So when it comes to a folder, Error 404 works properly, but when it comes to a file (first image), then Error 404 doesn't work, I just get a simple message "File not found".
Hello, this should be the error returned by your website program.
aaPanel_Kern Hello, this should be the error returned by your website program.
My website program is Apache 2.4 and I know that, The question is how do I fix that?
- Edited
Hello, it is recommended that you check .htacces and website programs
aaPanel_Kern Hello, it is recommended that you check .htacces and website programs
When you say website program, I assume you mean Apache?
Hello,
Website programs refer to the website program files you use for deployment, such as WordPress, etc.
aaPanel_Kern
No, it has nothing to do with the 404 error, the script I use does not do anything related to 404 errors or any other error.
The problem is that aapanel (apache) throws a 404 error when it's about a folder that doesn't exist on the server, but when it's about a file that doesn't exist on the server, such as xxxxx.php or xxxxx.html, it doesn't show error 404, but it should.
Just show this (see image):
Hello, it is recommended that you check the configuration of the website. The following picture shows the content when the newly added website files and directories I tested do not exist.
I will share my experience. The problem was not with the application I use on the server.
I found the answer here;:
https://stackoverflow.com/questions/50224464/custom-404-shows-file-not-found-for-php-files-instead-of-redirecting