Page admin and 200 server response

Initial data.
CMS Revolution 2.8.3-pl
The site is complete and working fine.
There is a 404 page.
The page header says header(“HTTP/1.1 404 Not Found”); , otherwise it returned 200 server response code.

Problem:
From somewhere, the page domain.com/admin appears
This page has a 200 server response even though the content is from a 404 page.

This page should not exist, and a 404 page with a 404 server response should open at that address.

Question:
how to get rid of this page or make it thaw 404 server code.

Redirects do not help in this case.

Your question is not entirely clear to me.

Does this mean that you created a resource that serves as your ‘error page’ and that you set the system setting error_page to the ID of this resource?


What do you mean by that? Is there a resource with the alias “admin”?

The default behaviour of MODX is, that the content of the error page is returned for every request, where no matching resource-alias is found. But the response status code should be 404 (and not 200).


If you find no other solution, you could add a RewriteRule for this specific case to your .htaccess file.

The 404 page exists and the error_page system setting is set to the ID of this resource.

Where the “admin” page came from is unknown. There is no resource with this alias. But when you open the page domain.com/admin
content page 404 and 200 server response is given

Redirects in the .htaccess file do not solve this problem

Are you sure it is a 200 server response?

  • Do you have a system setting error_page_header? (And if “yes”, what is the value?)
  • Are there any plugins on your installation that run on the event OnPageNotFound and may affect the default behaviour?

Are you saying that a line like this in .htaccess doesn’t work?

RewriteRule ^admin$ - [L,R=404]