Friday, August 11, 2017

WordPress Posts Returning 404 Error

    [SOLVED] The symptoms of this error is that when a user visits a single post on their site they get a 404 page – not found error. 
    The user can browse all other sections of their site including the admin area. The most common cause of this issue is permalink settings in WordPress. To solve this issue a user would need to reconfigure their permalinks settings or manually update their rewrite rules.
    Go to Settings » Permalinks, and simply click on Save Changes button.
    Update permalink settings
    This will update your permalinks settings and flush rewrite rules. In most cases this solution fixes the WordPress posts 404 error. However, if it does not work for you, then you probably need to update your .htaccess file manually.
    Login to your server using FTP, and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located. The easiest thing you can do is to temporarily make the file writeable by changing the permissions to 666. Then repeat the original solution. Don’t forget to change the permissions back to 660. You can also manually add this code in your .htaccess file:
    01# BEGIN WordPress
    02<IfModule mod_rewrite.c>
    03RewriteEngine On
    04RewriteBase /
    05RewriteRule ^index\.php$ - [L]
    06RewriteCond %{REQUEST_FILENAME} !-f
    07RewriteCond %{REQUEST_FILENAME} !-d
    08RewriteRule . /index.php [L]
    09</IfModule>
    10END WordPress

    Fix for Local Servers

    Often designers and developers install WordPress on their computers using a local server for testing purposes. If you want to use pretty permalinks, then you need to enable the rewrite_module in the Apache configuration of your MAMP, WAMP, or XXAMP.

    We hope this article helped you resolve posts returning 404 error in WordPress. Did this solution work for you? Do you have another solution that worked for you? Please share it in the comments below. We would like to make this article a comprehensive resource for users who run into this issue.

No comments:

Post a Comment