【发布时间】:2014-08-16 10:19:00
【问题描述】:
我目前在我的 .htaccess 文件中有这一行:
RewriteRule ^(20\d\d)/([A-Za-z0-9-]+)/$ /test/?type=post&year=$1&title=$2 [L]
它允许这样的 URL:
/test/?type=post&year=2014&title=hello
访问方式如下:
/test/2014/hello/
但是,有时我在重写的 URL 上什至还有另一个 GET 变量:
/test/2014/hello/?page=2
但是,页面上的 PHP 文件不会读取 get 变量 page。所以换句话说,我怎样才能改变我的 .htaccess 文件以允许 PHP 文件使用和读取其他 get 变量(添加到重写的 URL)?
【问题讨论】:
标签: php apache .htaccess mod-rewrite get