Title: problems with default rewrite rules in wordpress
Last modified: January 16, 2021

---

# problems with default rewrite rules in wordpress

 *  Resolved [darksid3](https://wordpress.org/support/users/darksid3/)
 * (@darksid3)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/problems-with-default-rewrite-rules-in-wordpress/)
 * first sorry for the english, it is not my language.
 * I recently had problems with pagination in the query, and I discovered that the
   problem was in the wordpress rewrite rule that did not direct correctly due to
   an excerpt:
 * “genero/([^/]+)/page/?([0-9]{1,})/?$”,
 * which should correspond to:
 * “index.php?genre=$matches[1]&paged=$matches[2]”
    (I was able to access normally),
 * after some time I managed to make it work by removing the expression and adding
   another rule without the excerpt : “{1,}”, what I would like to know is if this
   snippet is some kind of bug because all the custom types with this snippet are
   having problems, or if it is an error in my code
 * follow my solution:
 * `add_rewrite_rule( 'genero/([^/]+)/page/?([0-9])/?$', 'index.php?genre=$matches[
   1]&page=$matches[2]', 'top' );`
 * notice, I took the opportunity to replace the query var “paged” with “page”, 
   but I tried to search for “paged” before adding this rule
 * again sorry if it’s a big mess of mine, i’m new to it and if you need more information
   just let me know i’ll try to answer as soon as possible
 * I had also tried to flush the rules and change to /% postname% / in the permalinks
    -  This topic was modified 5 years, 3 months ago by [darksid3](https://wordpress.org/support/users/darksid3/).

The topic ‘problems with default rewrite rules in wordpress’ is closed to new replies.

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [rewrite_rule](https://wordpress.org/support/topic-tag/rewrite_rule/)
 * [slug](https://wordpress.org/support/topic-tag/slug/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [darksid3](https://wordpress.org/support/users/darksid3/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/problems-with-default-rewrite-rules-in-wordpress/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
