How to tweak your URLs without lost old references with Ghost

We basically need to rewrite every request to remove the date from our URL.

This is an example:  

We want to remove this bit 2014/11/21 to make it look like:  

Without lost all the previous references to the old URL

First thing to do:

We need to rewrite every URL coming that contain a date, so:

We have this:  

We want this:  

We need this to achieve that:

rewrite "\d{4}\/\d{2}\/\d{2}\/([^.]+)(.*)$" /$1$2 permanent;  

Change your configuration file:

I'm assuming you are using nginx

This is my configuration file:


so I need to add the previous line like so:

location / {  

        rewrite "\d{4}\/\d{2}\/\d{2}\/([^.]+)(.*)$" /$1$2 permanent;

Restart nginx

sudo service nginx restart  

Last thing to do:

We need to change the configuration of our Ghost to disable including the date into our URL's

And we're done :) all our old daties URL's are gone just clean and pretty ones.