≡ Menu

How to fix 404 Page not found error for WordPress Blog’s post+pages

Have you ever had your posts and pages not being shown on your WordPress blog when you or someone else click on a link to them. However, your Homepage for your WordPress blog display fine. This happen to me on a few occasions and it is rather annoying.

It is also an very easy fix the 404 error in most cases if you have backups of your blog, and just involves re-uploading a file into a root directory.

Most likely your .Htaccess file is missing, or broken because of a failed plug-in installed, file corruption, accidental deletion, and many other possibilities. This is why it is important to backup your blog on a regular basis to have a good copy of all your files and folders.

All you have to do is re-upload your ..htaccess file from your backups of your blog if you made them into your main WordPress directory which will most likely be /blog or /htdocs.

Use a FTP client like FileZilla, and re-upload your .htaccess file to your root directory. Click yes, if it asks you if you want to overwrite your.htaccess file Once you completed the .htaccess uploaded. Go to your blog and see if your posts and pages will load properly again instead of getting a 404 page not found error.

You can also try remaking the .htaccess file with notepad, and paste this code in it, and saving it as “all files” for the drop down menu and naming it .htaccess .

I pasted the two most common locations that a WordPress blog could be located and naming conventions. Notice the third line RewriteBase, and sixth line Rewrite rule ./path/index.php are different for both examples.

Example 1 on sub-folder/path of domain name.

/blog (www.example.com/blog)

# BEGIN WordPress
RewriteEngine On
RewriteBase /blog
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]

# END WordPress

Example 2 on root/main directory of domain.

htdocs/ (www.example.com, blog.example.com)

# BEGIN wordpress

rewriteEngine On
rewriteBase /
rewriteCond %{REQUEST_FILENAME}!-f
rewriteCond %{REQUEST_FILENAME}!-d
rewriteRule . /index.php [L]

# END wordpress

Also, you can try uninstalling caching plug-ins like W3TotalCache or WP-SuperCache to see if those caching plug-ins are preventing wordpress from loading your blog’s posts and pages correctly.

If you do not have a backup of your blog,  or my tutorial did not work, you can try reinstalling WordPress, or asking another wordpress blogger to make a copy of their WordPress .htaccess file, and see if it will work on your blog.

Make sure to make a backup of your blog first and all its images, themes, and plugins. Also, backup your database in Phpmyadmin for WordPress.

Good luck with your .Htaccess fixing problem.

If your homepage is also broken or have a 404 page not found error. Most likely you need to reupload your index.php file to your root directory or reinstall your theme. If you do not have a copy of your index.php file you can just download the wordpress install file and use the index.php inside the zip folder to upload to your root directory or you can use notepad to make a new index.php file  by pasting this code into notepad, and saving the text file as index.php and make sure all files is selected.

index.php for WordPress

<?php
/**
* Front to the WordPress application. This file doesn’t do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define(‘WP_USE_THEMES’, true);
/** Loads the WordPress Environment and Template */
require(‘./wp-blog-header.php’);
?>

<?php/** * Front to the WordPress application. This file doesn’t do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */
/** * Tells WordPress to load the WordPress theme and output it. * * @var bool */define(‘WP_USE_THEMES’, true);
/** Loads the WordPress Environment and Template */require(‘./wp-blog-header.php’);?>

You can also use the Export feature on WordPress, or backup your database and do a clean install of WordPress and import your XML file or reconnect your database on your new WordPress install. This should fix all your problems with WordPress.

If you have any additional tips for fixing 404 errors for WordPress, please post a comment in this post, thanks.

1 comment… add one
  • Projector Repair Fairfax April 6, 2011, 7:06 am

    Wonderful instructions. I am glad to hear from you. Looking forward for your updates.

Leave a Comment