WordPress is a powerful CMS. Sometimes a slight tweak can make your website inaccessible. A common problem that most WordPress users face at some point is WordPress posts returning a Page Not Found Error. This may even occur after some updates in theme/plugins or settings. In this article we will show you how to deal with page not found except home page error in your WordPress blog.
Usually in this scenario a user can access their WordPress admin area, their blog’s main page, but when accessing a single post they get a 404 Not found or page not found error. First of all, don’t panic most of the time your posts are still there and completely safe.
This usually happens if your .htaccess file either has something went wrong with the rewrite rules or got deleted. What you need to do is fix your permalinks settings.
Fixing that problem is very simple if you were using permalinks other than the Default such as Day and Name, Month and Name, Numeric, Post Name or Custom Structure, you only need to
- Login to your admin area
- Go to Settings > Permalinks
- Choose Default permalink setting
- Save changes
Visit your post and check if page not found except home page error has gone. Now you can return it again to your other previous permalink choice or keep it as default as you wish.
if it does not work for you, then you probably need to update your .htaccess file manually. You can do it using either of two ways given:
- Login to your server using FTP
- Look for the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located
- Temporarily make the file writeable by changing the permissions to 666. Then repeat the original solution provided above
- Don’t forget to change the permissions back to 660 after applying the solution
Alternatively you can also manually add this code in your .htaccess file (don’t forget to take a backup of your present code):
1 2 3 4 5 6 7 8 9 10 | # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress |
Visit any page of your site, refresh, and confirm that the page not found except home page error no longer occurs.
Last but not least, also try checking what your front page is set to in Settings > Reading.
If it’s your latest posts option selected then you must have at least one post and if you choose A static page as front page, you must have a valid page to resolve the page not found error in WordPress.