WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Permalinks not working on 3.1 (8 posts)

  1. docarzt
    Member
    Posted 3 years ago #

    Another site-breaking wordpress update. Does this stuff ever get tested before being released and destroying websites?

    /%category%/%postname%/%post_id%

    as a custom permalink structure is not working. Which means all of the pages indexed and linked to that use that permalink structure are NOT GOING TO WORK EITHER.

    I deleted .htaccess and let wordpress build it all over ... no help.

  2. docarzt
    Member
    Posted 3 years ago #

    This appears to affect permalink structures with %category% ONLY

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    There's nothing wrong with WordPress. That custom permalink structure works fine. I just tested it on 3.1, and everything works, no problems.

    However, using Category as the start of your permalink string is still a bad idea and can cause problems regardless of what version you're using.

    More info:
    http://ottopress.com/2010/category-in-permalinks-considered-harmful/

  4. docarzt
    Member
    Posted 3 years ago #

    Then why is not working for several people? It is clearly a WordPress problem.

  5. MikeMovies
    Member
    Posted 3 years ago #

    its not working for me. I removed all my plugins and got my NEWS page working but my category pages are still not working.

    i had a plugin removing category from my category pages which didnt work with 3.1 at all. Unfortunately once I removed that plugin things went from bad to worse since now my news loads but my category pages are all fubar.

  6. Ricard Torres
    Member
    Posted 3 years ago #

    Same problem here. Not working :S

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

  8. Hairudy
    Member
    Posted 3 years ago #

    Hi please use this code below, This two functions were added to our functions.php :

    // permalinks
    
    function fix_topics() {
          add_filter('rewrite_rules_array','fix_topics_rules');
          global $wp_rewrite;
          $wp_rewrite->flush_rules();
    }
    add_action('init', 'fix_topics', 20);
    
    function fix_topics_rules($rules)
    {
      global $wp_rewrite;
    
        $newrules = array();
        $newrules['topics/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$'] =  'index.php?category_name=$matches[1]&feed=$matches[2]';
        $newrules['topics/(.+?)/(feed|rdf|rss|rss2|atom)/?$'] =  'index.php?category_name=$matches[1]&feed=$matches[2]';
        $newrules['topics/(.+?)/page/?([0-9]{1,})/?$'] =  'index.php?category_name=$matches[1]&paged=$matches[2]';
        $newrules['topics/(.+?)/?$'] =  'index.php?category_name=$matches[1]';
        return $newrules + $rules;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.