admin管理员组

文章数量:1124409

I'd like to access the 404 page generated by wordpress through actually requesting it. It will need to be requested programmatically and I want to be sure it will always be the 404 content, so any random url to trigger an actual 404 wouldn't work. To make things right, it should also probably answer with the 200 http status.

A documentation page says it should be /index.php?error=404 but on my setup it only displays the homepage.

Has this been changed since the writing of the documentation or is it a bug ?

I'd like to access the 404 page generated by wordpress through actually requesting it. It will need to be requested programmatically and I want to be sure it will always be the 404 content, so any random url to trigger an actual 404 wouldn't work. To make things right, it should also probably answer with the 200 http status.

A documentation page says it should be /index.php?error=404 but on my setup it only displays the homepage.

Has this been changed since the writing of the documentation or is it a bug ?

Share Improve this question asked Mar 5, 2024 at 10:12 challetchallet 1114 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Yes this this doesn't work when you have custom permalinks enabled. See the red warning box on the page you linked:

WARNING: If you are using custom permalink, the trick below does not work, see this: http://core.trac.wordpress.org/ticket/7592.

The trac ticket was closed as invalid so doesn't look like this will change.

本文标签: 404 errorWhat is the correct url to request the 404 page