如何重写网址我喜欢这个
/details.php?pid={id}
exam: /details.php?pid={ee76f41017c6f6aa762a2bfb7def83c5}
我想要
/products/{id}/name
我试试这个
RewriteEngine on
RewriteCond %{QUERY_STRING} ^cat=(.*)
RewriteRule ^details.php /products/%1? [R=301]
和这个
RewriteEngine On
RewriteRule ^products/([^/]*)$ /details.php?pid=$1 [L]
答案 0 :(得分:0)
这应该有效:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /details\.php\?pid=(.*)\ HTTP
RewriteRule ^ /products/%2/name? [R=301,L]
以上内容会将details.php?pid={id}
更改为products/{id}/name