我正在尝试转换下面的网址:
index.php?id=585&rurl=%26ts1%3D64%26ts2%3D65%26ts3%3D18
友好网址:
/products/%26ts1%3D64%26ts2%3D65%26ts3%3D18/585/my-product-name.html
我尝试了以下操作但似乎问题rurl
param
RewriteEngine on
RewriteRule ^products/(.+)/([0-9]+)/(.*?).html$ /index.php?id=$2&rurl=$1
我是新手,我无法弄清楚。
如何为以下友好网址编写规则
/products/585/my-product-name.html?%26ts1%3D64%26ts2%3D65%26ts3%3D18
答案 0 :(得分:0)
您可以使用此规则:
RewriteEngine on
RewriteRule ^products/([0-9]+)/[^.]+\.html$ /index.php?id=$1 [L,QSA,NE]