我正在寻找的是从动态URL中剥离查询参数,该参数也需要使用HTACCESS进行清理。使用htaccess去除或重写已清理网址的查询字符串
url被重写为http://testdomain.com/post/3326/。
有些链接得到“?REF = no_set” 追加到结尾
地址现在需要从http://testdomain.com/post/3326/?ref=no_set重定向到http://testdomain.com/post/3326/
在某些情况下我需要添加一个新的查询参数“?ref = no_set”到网址,但我想知道是否有可能剥离该查询参数,并仍然能够使用$ _GET在PHP中检索它,即使它没有被重写。
任何帮助,将不胜感激!
我现在使用的RewriteRule是:RewriteRule^post /([0-9] {1,11})/ $ post.php?id = $ 1&ref = no_set [L,QSA]。 我可以从它剥离查询参数:RewriteCond%{QUERY_STRING} ref = RewriteRule(。*)http://testdomain.com/$1? [R],但是我这样做时无法使用$ _GET ... – stwhite