Custom rewrite rules for a page with GET variables?

So basically I have a WordPress page called games. Within this page I have a list of custom post type posts. Using a form and some $_GET magic, the user is able to filter the posts based on tags, as well as, first letter in the title.

The base url for the page is:

The URL for the filter looks like this:

The desired URL structure should look like this:

I’m looking to use the native WordPress API to set these rules, instead of hacking the htaccess file. After reading several posts, I am unable to create any working form of the desired URL structure. More importantly than having the end code, I would like to learn how this process works. Any help would be greatly appreciated.


Here’s a nice explanation of how rewriting is done in WP:

Also, might want to take a look at similar questions:

Writing Custom Rewrite Rules that Incorporate Category for Custom Post Types?

Source : Link , Question Author : Colin Morgan , Answer Author : Community

Leave a Comment