WordPress uses rewrites to allow
pretty permalinks. Simple Rewrite Rules plugin allows you to customize the URL of your WordPress blog even further.
How to use rewrites
If you aren't already familiar with Apache's
mod_rewrite, it is recommended that you have a look at it.
This plugin can parse
regular expression to rewrite one URL to another. The best way to understand this is through an example:
Rewrite
random-posts
to
index.php?orderby=rand
(Random posts)
Rewrite
(cats)|(dogs)
to
index.php?categoryname=$match[1]
(All posts under a certain category)
Rewrite
([^/]+)/popular/?
to
index.php?month=$match[1]&meta_key=votes&orderby=meta_value
(The most popular posts in the month)
Rewrite
user/([^/]+)/([^/]+)/?(/(.*))
to
index.php?authorname=$match[1]&day=$match[2]&categoryname=$match[4]
(The possibilities are endless!)
Quick Regular Expression References
List of All WordPress Query Variables
- attachment
- attachment_id
- author
- author_name
- cat
- category__and
- category__in
- category__not_in
- category_name
- comments_popup
- day
- error
- feed
- fields
- hour
- m
- meta_key
- meta_query
- meta_value
- minute
- monthnum
- name
- order
- orderby
- p
- page_id
- page
- paged
- pagename
- post__in
- post__not_in
- post_status
- post_type
- preview
- robots
- s
- sentence
- second
- static
- subpost
- subpost_id
- tag__and
- tag__in
- tag__not_in
- tag_id
- tag_slug__and
- tag_slug__in
- tag
- tax_query
- taxonomy
- tb
- term
- w
- withcomments
- withoutcomments
- year