To find out what is causing the problem, enable logging on your WordPress site.
The wp-config.php file should include the following lines just before the line “/ * That’s all, stop editing! Happy blogging. * /”:
define ('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define ('WP_DEBUG_LOG', true); / * That’s all, stop editing! Happy blogging. * /
After it, reproduce the 404 error and see the fatal errors on your wp-content/debug.log file.
After finding the cause of the problem, we can move on to the solution.