fix behavior of trailing slash redirection when a query string is involved (closes #23112)
merge 3.4 (#23112)