-
WordPress Shows 404 Error Codes On All Pages Except Home Page And Admin Page
Posted on November 22nd, 2009 No commentsDESCRIPTION OF PROBLEM
If you can view your WordPress Home page and the WordPress Admin page but all content pages show you the following (or similar) error message:404 - File Not Found
This typically means something broke. Here are two possible solutions to resolving this problem.
BACKGROUND INFORMATION
WordPress utilizes and creates a file called .htaccess.The default contents of the .htaccess file (should) look something like this:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPressFIX THE PROBLEM
This .htaccess file should be found in the root ( / ) directory of your html repository – this is where your WordPress installation resides. This of course will vary from server to server. You may need to consult with your network administrator for the exact details regarding the location.If you perform a directory listing and you do not see an .htaccess file or the file has been renamed to something like old.htaccess, this could be a good indicator of your immediate problem.
Possible Solution #1
If the .htaccess file was renamed, try viewing the file to verify that it matches the aforementioned default contents (refer to the section entitled BACKGROUND INFORMATION).If the contents of the .htaccess file resemble the aforementioned example, try renaming the file back to .htaccess and then attempt to preview your content pages.
If everything is as it should be — problem solved (sort of). — Refer to section entitled “POST MORTEM”
If this still does not resolve the issue, rename the .htaccess file to something like old.htaccess and perform “Possible Solution #2″.
Possible Solution #2
If the .htaccess file doesn’t exist at all, then try the following steps:Assuming the directory permissions on your server are set correctly, it is but a simple mater to perform the following steps to rectify the situation:
- Using your web browser, log into the WordPress Admin / Dashboard Page
- Click on Settings
- Click on Permalinks
- Click on Save Changes
Using this process, WordPress should re-create the .htaccess file and this should resolve the issue at hand.
Try viewing your content pages to verify that everything is working.
If everything is as it should be — problem solved (sort of). — Refer to section entitled “POST MORTEM”
If you still cannot resolve your issue, the problem might be much more complicated to answer. Please refer to http://www.wordpress.org/support/ for further assistance.
POST MORTEM
The BIG question is, “What caused the problem in the first place?”Unless you are the administrator of your server, this might be a difficult question to anwer.
Possible culprits are:
- Another piece of software could have modified, deleted or renamed the .htaccess file.
- Another person could have deleted or renamed the .htaccess file.
- Some sort of hardware failure or file corruption at the server level could have modified or deleted (lost) the file.
- Something else?
Even if you are not the network administrator, you should still make an effort to track down the cause of the error. If you are hosting your WordPress installation on an Internet Service Provider (ISP), contact your technical support representative and let them know what happened and the steps you took to resolve the problem. They might be able to provide further assistance as to why the problem occurred in the first place.
WordPress .htaccess, 404, background information, default contents, directory listing, directory permissions, error codes, error message, exact details, File Not Found, htaccess file, network administrator, page description, php, possible solution, possible solutions, post mortem, problem background, repository, rewritecond, rewriterule, root directory, WordPress, wordpress homeLeave a reply




