Problem with rewrite rules returned (2 posts)

  1. rshupe
    Posted 11 years ago #

    I have two servers both running the same versions of:

    • PHP (4.3.10)
    • Apache (1.3.27)
    • WordPress(

    The data on both servers is identical (except for the urls specified in the options) They are running the same plugins.

    My problem is that the rules returned by $wp_rewrite->wp_rewrite_rules() are different on the two servers. This causes url_to_postid() to fail when parsing my permalinks and I can not figure out why the rules returned would be different.

  2. rshupe
    Posted 11 years ago #

    Some further detail:
    The $wp_rewrite->wp_rewrite_rules() function returns an array of rewrite rules but the order of these rules is different on the two servers. 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 on the server that does not work and as a result the rules after it are not processed, and the url_to_postid() function incorrectly returns 0.

Topic Closed

This topic has been closed to new replies.

About this Topic