如何重定向保留查询字符串的用户?
示例1:
www.mydomain.com/pages/welcome.html?abc=123
到
www.mydomain.com/pages/welcomeNew.html?abc=123
示例2:
www.mydomain.com/pages/welcome.html?xyz=321
到
www.mydomain.com/pages/welcomeNew.html?xyz=321
我试过这个并不起作用?
RewriteEngine On
RewriteRule ^pages/welcome.html?([a-z0-9]*)$ www.mydomain.com/pages/welcomeNew.html?$1 [R=301,L,QSA]
答案 0 :(得分:0)
根本不需要?
。查询字符串将自动保留:
RewriteEngine On
RewriteRule ^pages/welcome.html$ /pages/welcomeNew.html [R=301,L,QSA]