WordPress is a CMS which is very powerful and used globally to build a website. Sometimes a slight tweak will make the website inaccessible. In this article, we will show about to fix the 404 Error thrown by the WordPress. This is one of the most common error occurred in WordPress which is easy to resolve. Usually, in this scenario, you can access your admin area, blog’s main page. But if you accessing the single posts it will show you a 404 not found error. The main cause of this error is .htaccess file got deleted or corrupted .htaccess file. You can fix the error by the following methods.

Permalinks settings:

To fix this issue, first of all, login to your WordPress admin dashboard. Click on the settings in the left menu bar. Click on the permalinks button which has shown from the side of the menu bar and click on save changes button. Now refresh your website and click on the individual posts which are showing 404 Error earlier. If it is opened correctly means you can confirm that the .htaccess file was deleted or corrupted. By saving the settings you had created a new .htaccess file.

Rewrite .htaccess via FTP:

If the above method is not working, then you need to rewrite the code in the .htaccess file through FTP. Here we have taken FileZilla as an FTP client. Now connect to your web server and navigate to the .htaccess file. Right click on it and download to your personal computer. Now add the below-mentioned code to the .htaccess file and upload it back to the website.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule. /index.php [L]

After uploading to the site, refresh your website and it will start working fine. You can also rewrite the codes via cPanel.

Rewrite the .htaccess via cPanel:

Also, you can rewrite the .htaccess code through cPanel. For that, log in to your cPanel and click on the file manager under the files section. Then navigate to .htaccess file which is available in public_html. Right click on it and click on edit option. Then add the above-mentioned codes in .htaccess in editor page and click on save changes button. Now refresh your website and check the posts. It will be working fine.

We hope that these methods will help you to fix the WordPress posts returning 404 Error. For more information, follow us on Twitter and Facebook. For video tutorials, subscribe to our YouTube channel “ServerCake India“.

Categorized in:

Tagged in: