1

我刚刚开始使用 mod-rewrite,但我无法弄清楚。这有效

RewriteRule ^client-(.*)?$ clients.php?client=$1  [NC]

这不

RewriteRule ^client/(.*)?$ clients.php?client=$1  [NC]

我试图让它看起来像client/nameclient而不是client-nameclient 我不明白为什么它不会占用我的斜线字符

我搜索并发现除了与结束斜线有关的东西,我什至尝试过

RewriteCond  %{DOCUMENT_ROOT}/client/$1  !-f

但是没什么区别

非常感谢

4

2 回答 2

1

看来,你有一个错字,因为我看到clients.phpclienti.php

RewriteRule ^client-(.*)?$ clients.php?client=$1  [NC]
                                 ^ this 

RewriteRule ^client/(.*)?$ clienti.php?client=$1  [NC]
                             and ^ are not same
于 2013-05-19T19:37:25.243 回答
0

您可能需要使用反斜杠来转义斜杠。

RewriteRule ^client\/(.*)?$ clienti.php?client=$1  [NC]
于 2013-05-19T19:29:20.833 回答