我想将http://www.example.com/products.php?id=WIZ页面重定向到http://www.example.com/newpage.php?nwmd=WIZ
我尝试了很多这个问题的组合,但它没有用! :(
答案 0 :(得分:0)
试试这个。
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^(.*)$ http://example.com/products.php?id=WIZ$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/newpage.php?nwmd=WIZ/$1 [R=301,L]
答案 1 :(得分:0)
此规则适用于您:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=([^&]+) [NC]
RewriteRule ^products\.php$ /newpage.php?nwmd=%1 [R=302,L,NC]