WordPress.org

Ready to get started?Download WordPress

Forums

Problem with rewrite rules and 404 handler (1 post)

  1. rshupe
    Member
    Posted 9 years ago #

    The $wp_rewrite->wp_rewrite_rules() function returns an array of rewrite rules but the order of these rules is a problem. The problem is the last rule on the server that works is:

    [(.+?)/?$] => index.php?category_name=$matches[1]

    This rule catches everything, the problem is that this rule is not the last rule returned and as a result the rules after it are not processed, and the url_to_postid() function incorrectly returns 0 which causes the 404 handler to fail.

Topic Closed

This topic has been closed to new replies.

About this Topic