【发布时间】:2018-03-07 11:38:27
【问题描述】:
现在我有以下网址 http://example.com/products/?category=clothes 我的主要逻辑依赖于从 url 接收到的 get 参数。 有什么办法可以将结构更改为 http://example.com/products/clothes ,并且还有包含衣服的类别参数吗? 我尝试使用 htaccess - 这个我试过了,还是不行。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^products/([^/]+)$ products/$1/?category=$1 [L]
【问题讨论】:
标签: .htaccess