A 404 error appears when you click on one of your WordPress posts and it is unavailable, but the solution is quite simple, thankfully. However, there is no clear reason as to why this problem occurs, which makes prevention difficult.

This has something to do with the permalink structure of your site, which is partially controlled by the file " .htaccess ". You are more likely to experience this problem if you use Pretty permalink As opposed to the default configuration of WordPress.

This does not mean that you should not use " Pretty Permalink ". It just means that your file .htaccess Has been deleted or corrupted in some way and you need to correct the problem as it is responsible for the 404 error that is displayed for your items.

Solution # 1: fix 404 error by resetting permalinks

This problem is usually caused by a file " .htaccess "Corrupted, as previously stated. Yours may have been deleted or damaged somehow, causing this 404 error when you access an article.

Fortunately, there is an easy way to generate a new file " .htaccess Which does not require you to leave the dashboard. All you need to do is open the " Settings », Select« Permalinks To access the permalinks settings page.

permalinks WordPress categories

Scroll to the bottom of this page, and click Save Changes. This does a number of different actions, including cleaning up your file's rewrite rules. This should be enough to fix the 404 error in most cases.

Solution no.2: reset write rules manually

If the simple two-click solution doesn't work, you may need to do a bit more to rewrite your ".htaccess" file. You will need to access your site through an FTP client for this. We have already shown you how to install WordPress with FileZilla.

All you have to do is log in to your space.accommodation, and activate the display of hidden files, in the “ public_html ", where the files are located your blog.

If you do not see a file .htaccess In the root directory of your site, you may need to force the FTP client to show hidden files. If you are on FileZilla, click on Server in the menu at the top, then select "Force show hidden files".

view-the-files-cache-ftp-filezilla

Once you have found your .htaccess file, right-click, and select file permissions. You can try to solve this problem by making the file .htaccess »Writable temporarily. Enter 666 as the numeric value for this, and click OK to save this setting.

refresh-of-files-on-server

Click "Refresh" on the toolbartools from FileZilla, to update your files. Go back to WordPress, go to permalink settings again and apply solution number 1 above.

You can then go back to FileZilla, and change the permissions of the file " .htaccess " for " 644 " For safety reasons. Refresh the FTP client when you are done.

Final Thoughts

Sometimes this problem has nothing to do with WordPress, the problem may be with your accommodation. Indeed, the permalink structure that WordPress offers requires a specific module on Apache, this is the module " mod_rewrite ". You must also reassure your host that the module is available.

That's all for this tutorial, I hope it will help you fix the 404 problem on your WordPress articles.