[New post] Redirect to date-less permalinks on WordPress with Caddy.
Ru posted: " Motivation I was advised, long-ago, that having dates in permalinks help a search engine determine how fresh the page is. With certain meta tags, my guess is they are no longer necessary. And who doesn't like clean links? Goal Say your permal"
I was advised, long-ago, that having dates in permalinks help a search engine determine how fresh the page is. With certain meta tags, my guess is they are no longer necessary.
And who doesn't like clean links?
Goal
Say your permalinks are like so:
/2021/09/13/block-images-appearing-in-search/
And now you have decided to move to a date-less permalink, like so:
/block-images-appearing-in-search/
If you self-host WordPress and use Caddy, here's what I did.
Configure Caddy.
I use a named regex path here (matcher). Then I ask any matches to be redirected (directive) to the fourth capture group in the regular expression. That is the post slug.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.