Hi everyone! I recently migrated from an rather old Ghost instance to a more recent one, and I realize few days after, that the new blog was using /slug URL directly instead of /year/month/day/slug.
I made the fix in the route file with now permalink: /{year}/{month}/{day}/{slug}/ so it’s OK. However, I did made a post before the change, and now I have a 404 if I use the URL without the date.
I took a look at the redirect YAML file, and in the doc there’s an example to go from date to slug directly:
But it seems to create redirect loop. What would be the best option? Until then, I made a rewrite in Nginx, but I would prefer to keep things in Ghost.
Oh huh. I’m not sure there’s a generic way to get year, month, and day into a generic redirect rule on the target side. (Hey @RyanF, if there is, it’d be nice to have it in the docs!)
Since it sounds like there’s only one post impacted, here’s how to deal with it:
Agreed, redirects are (currently) context-free, since there’s no way to know if you’re trying to do an (e.g.) affiliate redirect, or something like this.