htaccess重写规则为多个get

时间:2016-01-19 17:44:22

标签: .htaccess

如果有一个参数,我可以写对了。但是当get i的多个参数无法进行重写规则时

RewriteRule "^etkinlik-detay/(.*)/(.*)$" "$etkinlik-detay.php?club_sef_link=$1&sef_link=$2 [L]

我找不到页面错误。我该如何解决这个问题? 这是我所有的htaccess:

 Options +FollowSymLinks
RewriteEngine On    # Turn on the rewriting engine
RewriteRule "^bar/(.*)$" "bar.php?sef_link=$1"
RewriteRule "^etkinlik-detay/(.*)/(.*)$" "$etkinlik-detay.php?club_sef_link=$1&sef_link=$2 [L]

1 个答案:

答案 0 :(得分:1)

你需要删除"领先的$"来自你的第二个规则目标,

 Options +FollowSymLinks
RewriteEngine On    # Turn on the rewriting engine
RewriteRule "^bar/(.*)$" "bar.php?sef_link=$1"
RewriteRule ^etkinlik-detay/(.*)/(.*)$ etkinlik-detay.php?club_sef_link=$1&sef_link=$2 [L,NC]