我需要重写/删除部分旧网址whit htaccess。
旧网址:
/event/seometxt.15.html?id=14&utm_source=Facebook&utm_medium=post&utm_campaign=mypage
新网址:
/event/seometxt/?utm_source=Facebook&utm_medium=post&utm_campaign=mypage
答案 0 :(得分:0)
您可以在网站根目录中使用此规则作为第一条规则.htaccess:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*&)?id=[^&]*(?:&(.*))?$ [NC]
RewriteRule ^(event/[^.]+)\. /$1/?%1%2 [L,R=301,NC,NE]
# rest of your rules go here