gpt4 book ai didi

mod-rewrite - 模组重写 + QSA : Same querystring param in rewrite target and in querystring - Force use of target possible?

转载 作者:行者123 更新时间:2023-12-02 17:46:39 26 4
gpt4 key购买 nike

我们有以下重写规则:

 RewriteRule ^([A-Za-z0-9\_]+)$ index.php?rewrite=$1 [L,QSA]

我们想知道是否有一种方法可以让 ?rewrite=$1 优先于通过请求 uri 中的查询字符串传递的方法?

因为就目前而言,由于 QSA 标志(顺便说一句,我们确实需要)如果以下 url 被点击:

 http://www.domain.com/this_rewrite_will_match_the_above_rule?rewrite=some_value

PHP 中 $_GET['rewrite'] 的值将是some_value,而不是this_rewrite_will_match_the_above 规则

在我们进入并开始修改重写并添加 RewriteCond 以匹配查询字符串等之前......我们希望有一个标志可以设置,以便目标 url (index.php?rewrite=$1 in在这种情况下)优先于传递的查询字符串值。

希望这是有道理的。

谢谢。

最佳答案

有点黑

RewriteRule ^([A-Za-z0-9\_]+)$ index.php?%{QUERY_STRING}&rewrite=$1 [L]

之所以可行,是因为在 php 中,第二个 rewrite=... 覆盖了第一个。

关于mod-rewrite - 模组重写 + QSA : Same querystring param in rewrite target and in querystring - Force use of target possible?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13766323/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com