Title: Problem with rewrite rules returned
Last modified: August 18, 2016

---

# Problem with rewrite rules returned

 *  [rshupe](https://wordpress.org/support/users/rshupe/)
 * (@rshupe)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/problem-with-rewrite-rules-returned/)
 * I have two servers both running the same versions of:
    - PHP (4.3.10)
    - Apache (1.3.27)
    - WordPress(1.5.1.3)
 * 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.

Viewing 1 replies (of 1 total)

 *  Thread Starter [rshupe](https://wordpress.org/support/users/rshupe/)
 * (@rshupe)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/problem-with-rewrite-rules-returned/#post-229040)
 * 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.

Viewing 1 replies (of 1 total)

The topic ‘Problem with rewrite rules returned’ is closed to new replies.

## Tags

 * [rules](https://wordpress.org/support/topic-tag/rules/)
 * [url_to_postid](https://wordpress.org/support/topic-tag/url_to_postid/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [rshupe](https://wordpress.org/support/users/rshupe/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/problem-with-rewrite-rules-returned/#post-229040)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
