用三个get变量重写mod

时间:2011-12-20 08:32:05

标签: .htaccess mod-rewrite

我正在尝试映射网址

localhost/abc/meetings/?day=5&month=12&year=2011

localhost/abc/pages/list_meetings.php?day=5&month=12&year=2011

我的重写规则不起作用,

RewriteEngine On
RewriteBase /abc/
RewriteRule ^meetings/?day=([0-9]+)&month=([0-9]+)&year=([0-9]+)$ /abc/pages/list_meetings.php?day=$1&month=$2&year=$3 [L,QSA]

1 个答案:

答案 0 :(得分:0)

QSA会自动附加查询字符串,因此您无需在重写规则中处理get变量。这样的事情应该有效:

RewriteEngine On
RewriteBase /abc/
RewriteRule ^meetings/$ /abc/pages/list_meetings.php [L,QSA]