When I moved over to Ghost blogging platform, I chose Dated Permalinks, an option that allows for including dates in blog post URL. Realizing that the blog post URL is unique even without the Dated Permalinks option, I opted out of it. But by then I had already posted a few of my blog links on Dzone. This broke my links on Dzone. To fix that I used Nginx's rewrite module

Nginx's rewrite module allows you to use regular expression like so:

rewrite ^/2014/11/03(/email-no.*/)$ $1 break;

Above, I am stating that:

  1. For a URL starting with /2014/11/03/ AND
  2. Followed by email-no then capture the part starting with email-no till the end of the URL.
    Then, replace the URL with captured part of the URL (i.e. $1).

So then:
gets translated to:

Since I have the rewrite rule inside the location block with path of /, the rewrite module gets served URL part after the base URL.

For completeness sake, the relevant part of the location block is provided below:

location / {
	rewrite ^/2014/11/03(/email-no.*/)$ $1 break;
	rewrite ^/2014/11/14(/throw-dy.*/)$ $1 break;