Home
/
Website Help
/
Stats and Errors
/
How to Fix the HTTP Error ‘404 - Not Found’ in WordPress

How to Fix the HTTP Error ‘404 - Not Found’ in WordPress

In the article below we will focus on the most common reasons for a website to display a “404 Not Found” error message – a deleted .htaccess file, or an issue with your website’s rewrite rules and redirects.

Save permalinks to fix WordPress posts returning error 404

If your 404 error is appearing on your WordPress posts, this is usually caused by a deleted .htaccess file or an issue with your website’s rewrite rules. To fix the error, go to your WordPress dashboard > Settings > Permalinks > click on the Save Changes button. Then, refresh your website and check if the error has disappeared.

If the issue persists or if you don’t have access to your WordPress dashboard, log into your SiteGround Client Area > Websites > Site Tools next to the desired website. Then, go to Site > File Manager > root directory (public_html) and navigate to the .htaccess file. Before making changes, right-click on the .htaccess file, select Rename and add ‘old’ at the end of its name in order to keep a backup, and click Confirm.

Then, select the .htaccess file and then click on the pencil icon ✎ to start editing the file. In the editor window, paste the following code:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Save the changes on the file and reload the page again.

The content you are trying to reach is actually not uploaded

404 error might be caused also if the page that is supposed to be reached is uploaded to a wrong location. The right location is usually the public_html directory for your main website or a subdirectory within the public_html directory for a subdomain or other folder.

To check that, go to your SiteGround Client Area > Websites > Site Tools next to the desired website. Then, go to Site > File Manager. In the left column, search for the public_html folder and make sure you have the desired file inside of it. If the file is not there, place it there using the upload button.

Some SEO/SEF (Search Engine Friendly) functionality of your application is not properly set up.

Many customers use open source applications like WordPress, Joomla!, Drupal, etc. on their web hosting accounts. Some of these applications require that a special functionality is enabled to generate Search Engine Friendly URLs. Very often enabling this functionality includes some editing of the .htaccess file.

A common cause of a “404 Not Found” error is resulting from some incomplete or wrong rules in the .htaccess file or another mistake in the setup of the SEF functionality. So, if you start seeing the “404 Not Found” error after you have tried to enable the SEF functionality of your application, check if you have set it up properly.

Share This Article