Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

/blog/2012/04/my-post/

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:

/blog/2012/04/my-post.html

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

1 Answer 1

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:

/blog/%year%/%monthnum%/%postname%.html
share|improve this answer
    
This is a great answer. –  MathSmath Apr 27 '12 at 16:16

Your Answer

 
discard

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.