By default WordPress is built to autocomplete similar URLs in order to avoid 404.
This is causing some issues because we recently developed a new website and we needed to redirect old links to the new ones by creating custom 301 rules in .htaccess file.
The old links are slightly different from the old ones and the first part of them are similar.
For instance, if we make a redirect like this in .htaccess:
Redirect 301 /stat/param_taram/2009/ /statistics/param-taram/2009-abc/
WordPress is redirecting us to
/statistics/param_taram/2009/ which does not exist. As we can see, it tried to redirect the first part of URL from
/statistics/ but did not looked for the rest of URL which is causing a 404
I searched for any available solutions posted on https://core.trac.wordpress.org/ticket/16557 and also on StackExchange but any of those solutions did not helped for my situation.
Any suggestions on how to fix this?