测试环境centos
windwos系统一般直无需转义。
网址带"?aaa"往后全部切掉。
RewriteEngine On
RewriteCond %{QUERY_STRING} ^aaa$
RewriteRule ^/($|/.*) /$1 [R=301,NE,L,NC]
网址带空格。(用"")
SetEnvIf Host "xxx.xxx.com" CorporateItems=yes
RewriteCond %{ENV:CorporateItems} yes
RewriteRule "^/yokohama land($|/$|.aspx$)" https://xxx.xxx.com/yokohamaland [R=301,NE,L,NC]
带特殊符号。(用\)
RewriteRule ^/ja-jp/group/toko/inquiry/form($|/$|.aspx$) https://xxx.xxx.com/contact/form?Type=\%e3\%83\%aa\%e3\%82\%af\%e3\%83\%ab\%e3\%83\%bc\%e3\%83\%88\%e3\%81\%ab\%e3\%81\%a4\%e3\%81\%84\%e3\%81\%a6 [R=301,NE,L,NC]