Wp error page 404 which should give server response 404 always gives 200

wp error page 404 which should give server response 404 always gives 200 Successful resource request.

Please help me fix this!
on another server the response is 404, as it should be

I installed test wp on a free domain https://legion2.rf.gd/404-page-non-existent , and the same problem

The 404 page should respond 200, as content is found. It’s the original page that responds 404

4 Likes

When I enter any address that does not exist, then always on your hosting with WordPress installed the server gives the response:
Server response code - 200 Successful resource request

but it should be:
Server response code - 404 Unsuccessful resource request

If the page does not exist, then the response should be 404 and not 200!!
This is how it works everywhere. Please study the issue.

If non-existent pages give code 200, then it will be search spam, there will be a bunch of useless erroneous pages in the index.

Enter a crooked (non-existent) address on any WordPress site on your hosting and see what response the server gives. It will be 200 instead of 404.

Please tell me how to fix this.

That’s not a hosting issue, but a files-on-your-website issue. If you believe this stems from WP, please contact their helpdesk.

3 Likes

I checked the same site on another server, and the 404 page gives a 404 response, everything works correctly.

It does not work correctly on your hosting.

To avoid a crash of these files of this site, I installed a free domain on your hosting in a new WordPress, and it does not work correctly, the 404 page gives the response:
Server response code - 200 Successful resource request

And it should be:
Server response code - 404 Unsuccessful resource request

If you do not believe me, install WordPress on a free domain on your hosting and check.

The problem is not with WordPress but with hosting!

Please tell me how to fix this.

https://legion2.rf.gd/404-page-non-existent

Where are you checking these things? From a tool? They wouldn’t likely work properly because of the security system that prevents them from accessing your site (but search engines are whitelisted as a side note).

To actually check whether the correct status code is being applied, you can do it through your browser’s dev tools. Example, here is what I see on a non-existent page of your site when I inspect it, which indicates it is properly applying the 404 status code:


So you can safely ignore the tool being unable to detect the correct status codes.

7 Likes

I tried on different sites that check the server response and on sites with SEO optimization check, and all give an error - page response problem 404, incorrect response code - 200

All sites give a response of 200 instead of 404.

But I managed to find out with the help of GPT chat that the request

curl -I -A β€œMozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)” https://legion2.rf.gd/404-page-non-exi

The server, Google search bots, etc., gives the correct response 404, I suspect that other sites receive a response of 200 because of the hosting stub that counts visitors. The main thing is that search bots see the correct answer!

I hope this information will be useful to someone and save time. Thanks everyone!

The 404 page is working fine from here:

Please note that any external check scripts will not work because they are blocked by this security system:

Nothing is wrong with your website. Just don’t blindly trust what external scanning tools say.

5 Likes