How to Fix the “404 Forbidden” Error in WordPress

If you’re using WordPress and find yourself encountering 404 Not Found or Forbidden error pages, don’t worry, you’re not the only one. These errors can be distracting, but with a little troubleshooting, they can often be resolved. In this blog, we’ll explore common causes for these errors and provide you with instructions on what to do when you troubleshoot and solve them, ensuring your WordPress site is running smoothly and your visitors can view your content without encountering any issues. Let’s get started and resolve these errors head-on!!

As you can see in the image above, it has an error page. The reason why this is showing is that the root cause of this is misconfigured NGINX configuration. This refers to a situation where the NGINX web server is not properly set up or configured, leading to issues with the server’s functionality or security.

To fix this follow these steps:

  1. Log in to AWS and go to the Amazon Lightsail console.
  2. Connect to the Lightsail instance via SSH by clicking the CLI icon as shown below:

3. Enter these commands

cd /etc/nginx/sites-available
ls -lrt

Now, we need to edit the file “irenebonso” by entering this command

vi irenebonso

Replaced the “=404” with the following:


Save the file by entering this command


Now check the website if there are no error occurs

You can now proceed with your website. Hope this can help fix your error page!

Leave a Comment

Your email address will not be published. Required fields are marked *