My WordPress blog suddenly seems to have started giving me 404 errors when accessing category pages. For example, http://blog.rtwilson.com/category/tok-related/. Interestingly, this doesn’t happen for child categories (such as GIS and Remote Sensing, shown in the sidebar on the above link) but does happen for parent categories (eg. Academic) and categories with no children (like TOK-related).
Does anyone have any ideas why this might have happened? I recently changed the permalink structure for my blog posts themselves, but not for the categories. Do I need to rebuild the category list somehow? If so, how?
Update
.htaccess file content:
# 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
First thing to try is resave your permalinks from WordPress admin.
And be sure your changes are saved to
.htaccess
. if WP warns you that.htaccess
isn’t writable, manually use FTP to change the permissions of the.htaccess
file to 644 and try again.The “.” in front of the file name means it’s a normally invisible file, so check your FTP client to be sure it will display invisible files if you don’t see an
.htaccess
file in your web directory. The.htaccess
file will be at the same directory level as yourindex.php
file indicated by the Site address (URL) setting on your General Options page.This is a standard WordPress rewrite block:
If you get a 500 server error, that means the character encoding of the file is wrong and might have been changed when/if you edited the .htaccess file. You can try renaming the current .htaccess file and use your FTP client to create a new file and name it .htaccess.
If you still get 404’s or strange behavior after saving permalinks and seeing that the
.htaccess
file has the rewrite block above, try addingin your themes’ functions.php file, go back and refresh the homepage, then remove the code. That will clear out rewrite rules in the cache and in transients.
There are more troubleshooting tips and examples at Using Permalinks « WordPress Codex
I don’t get a 404 error on that page, but to answer the question: I have no idea why this happens or it does not happen.
Each time you change the permalink structure in the admin, permalinks get automatically rebuild, so you do not need to care about that. And there is no such thing as rebuilding the category list, so you do not need to wonder about that.
I had the same problem – I had installed ‘advanced permalinks’ plugin, and it has a bug… turns out that commenting out this line
in the plugin. Oringal answer not mine (although it worked for me) but was from here
I have install “Advance Permalink” plungin by John Godley, on 31st March’ 2015 for redirect me previous permalink structure of http://punch2crunch.com
After 36 hours my all cotegories start creating automatically 404 errors and one category working but sick to single post. If this same is happening with you then you have to paste a thing only.
Follow the steps:
Scroll down till you found below code
Simply put two forward slashes // before $this->add_filter (‘category_rewrite_rules’); like below
Refresh your site, and everything will start working perfect again. If not then have to find somewhere else.
I had same kind of issue.