我知道如何在相反方向重写并处理查询字符串,但我需要基于标记或类别(小写)创建一个查询字符串参数。因此,我可以在我的页面中将查询字符串用作搜索参数:将URL重写为查询字符串
例如,
news/tag/Shipping/ ==> http://www.example.com/news/?tag=shipping
news/category/Other/ ==> http://www.example.com/news/?category=other
试图
RewriteEngine On
RewriteRule ^news/([^/]*)$ /?tag=$1 [L]
谢谢。
你能分享一下你试过的吗? – starkeen