3
我想将“http://www.suma.ir/product.php?id_product=12”重定向到“http://www.suma.ir/product.php?id_product=508”,但我有麻烦。 URL路径应该保持不变,我想要做的就是更改查询字符串中的ID。我需要做些什么来完成这项工作?如何使用重定向更改查询字符串参数的值?
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^suma\.ir$ [NC]
RewriteRule ^(.*)$ http://www.suma.ir/$1 [R=301,L]
# This is the part that isn't working
Redirect 301 /product.php?id_product=12 http://www.suma.ir/product.php?id_product=508
您是否对product.php有'控制'?如果是这样,您可以在该PHP页面中编写此更改。 – trojanfoe 2011-02-08 07:55:06