使用PHP重定向并跳过特定参数

由于我已经开始在网站上使用友好的URL,因此,仅当注册用户的个人资料中包含“用户名”时,我才会将每个页面重定向到新版本。

所以,我从重定向:

https://tribbr.me/post.php?id=850

与:

header("Location:/".$if_username."/post/".$post_id."?".$_SERVER['QUERY_STRING']); exit();

To keep all GET parameters.... but the problem is that this header request, obviously with $_SERVER['QUERY_STRING'] is adding the post id too to the URL, and when redirected, this is the final URL:

https://tribbr.me/TribeMasters/post/850?id=850

Is it possible to just skip the id=850 parameter to the URL redirection?

感谢您的帮助:)