Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
share|improve this question
    
I don't get any 404 error on blog.rtwilson.com/category/tok-related –  hakre Dec 24 '10 at 2:36
    
Those are normal permalinks, and your categories seem to be working now. –  songdogtech Dec 24 '10 at 3:07
add comment

4 Answers 4

up vote 1 down vote accepted

Apparently this is a common problem with WordPress 3.1+ (just had to fix it on a site I built too). You can get a plugin or a code snippet for your functions.php to fix the problem here: http://wpcodesnippets.info/blog/how-to-fix-the-wp-3-1-custom-permalinks-bug.html

share|improve this answer
    
An answer should be more than just a link to an external site. Please add a solution. –  toscho Nov 18 '12 at 22:20
add comment

First thing to try is resave your permalinks. And be sure your changes are saved to .htaccess. If WP warns you that .htaccess isn't writable, manually edit .htaccess. See Using Permalinks « WordPress Codex

share|improve this answer
    
WP didn't warn me about anything. The permalinks for the blog posts are working fine, it's just the category pages and I didn't change the permalink structure for those! –  robintw Dec 23 '10 at 20:07
    
I read that; but the first step is to resave your permalinks anyway. –  songdogtech Dec 23 '10 at 20:10
    
Thanks. I've resaved my permalinks preferences, and checked .htaccess. The .htaccess file has a modified time of the time that I resaved the permalink preferences. I've put the contents of the .htaccess file at the bottom of the question. –  robintw Dec 23 '10 at 20:38
    
Try adding global $wp_rewrite; $wp_rewrite->flush_rules(); in your themes' functions.php file, go back and refresh the homepage, then remove the code. –  onetrickpony Dec 24 '10 at 2:14
add comment

Does anyone have any ideas why this might have happened?

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.

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?

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.

share|improve this answer
add comment

I had the same problem - I had installed 'advanced permalinks' plugin, and it has a bug... turns out that commenting out this line

$this->add_filter ('category_rewrite_rules');

in the plugin. oringal nswer not mine (although it worked for me) but was from http://wordpress.org/support/topic/advanced-permalinks-category-links-not-working

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.