Closed drzraf closed 6 months ago
Thanks for your contribution @drzraf it's really appreciated, I just came across a similar issue. The problem is that redirections to other sites that have the same behaviour will still result in a redirection to a trailing slash URL. So just making the exception for local URLs doesn't solve the problem.
The root cause is that the trailing slash is stripped from all TO urls (in sanitise_and_normalise_url()
). We're looking at fixing it there.
Sorry for the delay.
I think the behaviour was perhaps written with external URLs in mind, but it should probably accept what was specifically entered by the user. I think the PR looks good, will do a full review now.
WP common configuration adds a trailing-slash to URL.
trailingslashit
is in charge for this.When redirecting to a local URL, omitting the trailing-slash incur another redirect for the purpose of adding the slash. The current code always drop that slash implying two redirections.