2013-05-19 42 views
0

我剛剛開始使用國防部重寫,我無法弄清楚什麼。 這工作國防部重寫不會接受我的斜線

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

這不

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

我想使它看起來像client/nameclient代替client-nameclient 我不明白爲什麼它不會把我的斜槓字符

我搜索了一下,發現什麼都沒有,但有關結尾斜線的事情,我甚至試過

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

但沒有什麼區別

非常感謝

回答

0

這可能是因爲你需要用反斜槓來逃避斜線。

RewriteRule ^client\/(.*)?$ clienti.php?client=$1 [NC] 
+0

我已經試過了也沒什麼區別 – adriana

+0

我認爲這是與AllowEncodedSlashes,我加時這行AllowEncodedSlashes在它上面說500內部錯誤 – adriana

+0

不,它是不同的事情:(( – adriana

1

看來,你有一個錯字,因爲我看到clients.phpclienti.php

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

RewriteRule ^client/(.*)?$ clienti.php?client=$1 [NC] 
          and^are not same 
+0

嗨,並感謝您閱讀 – adriana

+0

不,這只是我複製粘貼,問題不是這個 – adriana

+0

好吧,你有沒有嘗試添加額外的'/'像'^ client //'? – samayo