We're already storing a history of slugs for each post, now we should make sure the client is accessing the post by its canonical URL. This allows the blog author to change a post's slug (and therefore URL) without breaking links.
Simply check if the requested slug equals the canonical slug; if not, do a 301 redirect to the post's URL.
We're already storing a history of slugs for each post, now we should make sure the client is accessing the post by its canonical URL. This allows the blog author to change a post's slug (and therefore URL) without breaking links.
Simply check if the requested slug equals the canonical slug; if not, do a 301 redirect to the post's URL.