rewrite

Custom rewrite rules with pagination in wordpress

Sometimes we need to use $_GET params in custom pages for something like custom filter.
In my case i must create page with custom query_posts, filter this posts and glossary. In glossary links must look like site.com/glossary/a/ or site.com/glossary/b/

First we need to create page with slug 'glossary' and set permalink to Post name.
In theme directory copy page.php to page-glossary.php and put this code