[英].htaccess RewriteRule issue I cannot resolve
當前網址:
/shop/?display=category&id=cloths
改寫為:
/shop/cloths
遵循以下規則:
RewriteRule ^shop/([^/\.]+)$ /shop/index.php?display=category&id=$1 [L]
麻煩的是我需要能夠向URL添加更多的$ _GET變量,例如:
/shop/cloths?page=2
我無法弄清楚為此所需的規則。 我也不想限制額外變量的名稱,所以我可以這樣:
/shop/cloths?page=
/shop/cloths?filter=
/shop/cloths?page=&filter=
只需添加QSA
標志:
RewriteRule ^shop/([^/\.]+)$ /shop/index.php?display=category&id=$1 [QSA,L]
http://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.