Category links suddenly started giving 404 errors

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?

Read More

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

Related posts

Leave a Reply

5 comments

  1. 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 your index.php file indicated by the Site address (URL) setting on your General Options page.

    This is a standard WordPress rewrite block:

    # 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
    

    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 adding

    global $wp_rewrite; $wp_rewrite->flush_rules();
    

    in 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

  2. 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.

  3. 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 answer not mine (although it worked for me) but was from here

  4. 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:

    1. From dashboard, Go to plugins, choose editor.
    2. Select “Advance-permalink/Advance-permalink.php
    3. Scroll down till you found below code

      $this->add_filter ('post_rewrite_rules');
      $this->add_filter ('author_rewrite_rules');
      $this->add_filter ('category_rewrite_rules');
      $this->add_filter ('rewrite_rules_array');
      
    4. Simply put two forward slashes // before $this->add_filter (‘category_rewrite_rules’); like below

      $this->add_filter ('post_rewrite_rules');
      $this->add_filter ('author_rewrite_rules');
      //$this->add_filter ('category_rewrite_rules');
      $this->add_filter ('rewrite_rules_array');
      

    Refresh your site, and everything will start working perfect again. If not then have to find somewhere else.

  5. I had same kind of issue.

    • Make sure Apache rewrite module enabled and proper .htaccess file
    • If above step not working, Go to permalinks settings and enter category base as “category”
    • Some SEO plugins own rewrite may give you issue
    • If you have any cache plugin, clear that.