WordPress Error: 404 Not Found error was encountered

Error

Not Found
The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Solution

If you’re experiencing 404 errors when trying to access specific pages on your WordPress site, but the homepage and admin login page are working fine, it could be due to a few common issues related to permalinks or server configuration. Here are some steps you can take to troubleshoot and resolve the problem:

1. Check Permalinks Settings

The most common cause of 404 errors for pages is an issue with WordPress permalinks.

  • Reset Permalinks:
    1. Go to your WordPress dashboard.
    2. Navigate to Settings > Permalinks.
    3. Without making any changes, click the Save Changes button. This action rebuilds the .htaccess file and flushes the rewrite rules.

2. Check the .htaccess File

If resetting permalinks doesn’t work, you might need to manually update or create the .htaccess file in your WordPress root directory.

  • Update .htaccess:
    1. Access your site via FTP or a file manager in your hosting control panel.
    2. Find the .htaccess file in the root directory of your WordPress installation.