htaccess url有斜杠不匹配

时间:2012-09-23 07:32:26

标签: php apache .htaccess url mod-rewrite

我在.htaccess文件中有以下配置:

Options -Multiviews -Indexes +FollowSymLinks
RewriteEngine on
RewriteBase /coaster/CoasterInsider/
RewriteRule searchResults/keyword/(.*)/?$ index.php?page=searchResults&keyword=$1 [L,NC]
RewriteRule searchResults/keyword/(.*)/start/(.*)/?$ index.php?page=searchResults&keyword=$1&start=$2 [L,NC]

start=$2不匹配。例: 网址是:localhost/coaster/CoasterInsider/searchResults/keyword/a/start/3/ 但是当我尝试echo $_GET['keyword']打印a/start/3/并且开始时没有获得任何价值。

1 个答案:

答案 0 :(得分:1)

请尝试颠倒最后两条规则的顺序。