旧网址- test.com/our-stores/nearest/?view=locations&storename=New%20York%20City
新网址- test.com/our-stores/纽约市
当前,我已经完成了重定向....
RewriteEngine on
RewriteCond %{QUERY_STRING} ^view=([^&]+)&storename=([^&]+)
RewriteRule ^our-stores/nearest/$ http://test.com/our-stores/%2? [R=301,L]
哪个去...
test.com/our-stores/New%20York%20City
我尝试了多种方法来删除%20(例如,通用%20替换),但是它不适用于旧网址之类的参数...
RewriteCond %{THE_REQUEST} (\s|%20)
RewriteRule ^([^\s%20]+)(?:\s|%20)+([^\s%20]+)((?:\s|%20)+.*)$ $1-$2$3 [N,DPI]
RewriteRule ^([^\s%20]+)(?:\s|%20)+(.*)$ /$1-$2 [L,R=301,DPI]
有什么想法吗?我觉得我已经尝试了数百种组合:(