I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
Leave a Reply
You must be logged in to post a comment.
I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
You must be logged in to post a comment.
This is done by
redirect_guess_404_permalink()
, which is called fromredirect_canonical()
.redirect_canonical()
does more than just this: it makes sure you are always using a single canonical URL for an item, it will add slashes, force the same domain name, …You can either unhook
redirect_canoncial
so it does nothing, or you can hook into it and prevent redirection when it is a 404: