htaccess规则包含两个查询字符串

时间:2014-09-02 14:28:41

标签: .htaccess mod-rewrite

所以我有一个网址:

www.example.com/?action=viewCategoryName&categoryName=Events&page_identifier=about

如果输入以下内容,我想创建一个返回页面的规则:

'www.example.com/events/about'

是否可以编写规则以包含两个查询字符串?我已经提出了以下内容,但它没有按预期工作。

RewriteRule ^$2/([a-z0-9,&-]+)/?$1 ?viewCategoryNameandArticle&categoryName=$2&page_identifier=$1 [L,NC,QSA,B]

非常感谢! 亚当

1 个答案:

答案 0 :(得分:1)

您可以使用此规则

RewriteRule ^([^/]+)/([^/]+)$ /?action=viewCategoryName&categoryName=$1&page_identifier=$2 [L]
相关问题