Community

Website not returning correct 404 500 403 status code instead 302

de
demoman #1

hey

my install version:

My website files are just some html and php files.

When accessing a non-existing directory or file, the server returns a 302 code instead of a 404 status code:

Accessing the existing directory, that is, 403 will redirect infinitely to 404.html

Due to user restrictions, I have merged all images:

my .htaccess fiel:

Rewrite Rules Added by CyberPanel Rewrite Rule Generator

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

End CyberPanel Generated Rules.

Rewrite Rules Added by CyberPanel Rewrite Rule Generator

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.)$
RewriteRule ^(.
)$ http://%1/$1 [L,R=301]

End CyberPanel Generated Rules.

But my other websites, wp, laravel, etc. are all normal and can return the error status code normally!!!

Dr
Dreamer #2

For security reasons very first thing update your cyberpanel.
Then delete .htacces, go to wp-admin set site domain https://www or non www after that go permalinks and press save then start adding rules .htacces

de
demoman #3

I upgraded the version and it didn’t seem to fix the problem

Sign in to reply