以下是原因:
This part 的redirect_canonical()
正在删除前导&
在重定向查询部分:
// tack on any additional query vars
$redirect[\'query\'] = preg_replace( \'#^\\??&*?#\', \'\', $redirect[\'query\'] );
示例:
example.tld/?&a=1&b=2&c=3
被重定向到
example.tld/?a=1&b=2&c=3
如果你必须领先
&
您可以尝试通过
redirect_canonical
过滤器:
/**
* Filter the canonical redirect URL.
*
* Returning false to this filter will cancel the redirect.
*
* @since 2.3.0
*
* @param string $redirect_url The redirect URL.
* @param string $requested_url The requested URL.
*/
$redirect_url = apply_filters( \'redirect_canonical\', $redirect_url, $requested_url );