Q:

Using `rack-rewrite` to Remove the Month and Date from a Permlink

I've started the process of moving my blog to Octopress, but unfortunately, a limitation of Jekyll doesn't allow me to use abbreviated month names for my permalinks. Therefore I'm looking to just get rid of the month and day bits altogether.
I'ved read in this article that you can use rack-rewrite to take care of the redirection, since I am using Heroku to host this.
So how would I turn:
This: example.com/journal/2012/jan/03/post-of-the-day/
Into this: example.com/journal/2012/post-of-the-day/

Extra points: If I had another rule that redirected /blog/ to /journal/, would that rule still adhere to the above one as well? So from:
This: example.com/blog/2012/jan/03/post-of-the-day/
To this: example.com/journal/2012/jan/03/post-of-the-day/
And finally to: example.com/journal/2012/post-of-the-day/
Thanks for the assistance in advance. :)

A:

You want to be as specific as possible, so you don't accidentally rewrite something else that would fail when it hits the new URL structure. Also note that I don't know rack-rewrite, so I'm following redroot89's lead on that point. 
r301 %r{^\/(:blog|journal)\/([0-9]{4})\/[a-z]{3}\/[0-9]{2}\/(.*)\/$}, '/journal/$1/$2/
This captures just the year and slug, but finds the rest by more specific patterns. And by including the (:blog|journal) you can redirect both in one shot, without having to chain two redirects together.

