传入网址
attorneys/attorney_detail.php?AttorneyID=23&Source=Title&Title=Partner
输出网址/attorney/static-name-here/
我尝试了很多方法来进行重定向,但它没有正确匹配,只是希望ID=##
与attorneys/attorney_detail.php
部分在一起。
这是我到目前为止所拥有的...... 我想删除尾随查询字符串。
RewriteCond %{QUERY_STRING} AttorneyID=23 [NC]
rewriterule ^attorneys/attorney_detail.php http://www.web.com/attorney/name-here/ [R=301,L]
答案 0 :(得分:0)
您可以使用:
RewriteCond %{QUERY_STRING} (^|&)AttorneyID=23(&|$) [NC]
RewriteRule ^attorneys/attorney_detail\.php$ /attorney/name-here/? [R=301,L,NC]
将删除任何现有查询字符串中的 ?
。