WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It's pretty common to see Wordpress running on pretty permalinks in the style of:


However I'm trying to customize a fresh Wordpress install with a different set of URLs. I believe wp_rewrite is my best method, writing a small block of code inside functions.php. I have seen a few examples of wp_rewrite_rules but none appear to be simply changing all post URLs.

Ideally I'd like to have them setup like this:


I would love any help on this if possible.. it's been a struggle finding good code examples for even basic rewrite rules. Let me know if I can provide any more details.

share|improve this question

migrated from stackoverflow.com Apr 27 '12 at 15:22

This question came from our site for professional and enthusiast programmers.

possible duplicate of Using wp_rewrite to make URLs ending in .html – Chip Bennett May 25 '12 at 16:05
up vote 4 down vote accepted

You don't need custom rewrites for that, you can simply use the permalinks settings to achieve those results. Click the Custom Structure option and enter:

share|improve this answer
This is a great answer. – MathSmath Apr 27 '12 at 16:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.