2014-05-22 105 views
0

這可能已經存在,但我似乎無法找到答案,現在搜索一段時間後。.htaccess rewriterule 500內部錯誤

嗯,這是我想要的東西:

http://example.com/user/blitzen12 
http://example.com/properties/1 

.htaccess文件

Options FollowSymLinks 
RewriteEngine On 
RewriteBase /example.com/ 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^user/([^\/]*)\/?$ ./user/user-page.php?name=$1 [L,QSA] 
RewriteRule ^properties/([^\/]*)\/?$ ./properties/property-page.php?pid=$1 [L,QSA] 

的問題是,當我嘗試訪問http://example.com/properties/1而第一重寫規則存在我500內部錯誤。 但是當我嘗試刪除或評論第一個重新編寫代碼時,一切正常。

或當我嘗試訪問http://example.com/agents/blitzen12而第二重寫規則存在,我得到了同樣的錯誤,它的工作很好,當我刪除了第二次重寫規則

阿帕奇完整的錯誤日誌

[Thu May 22 14:59:12.940137 2014] [core:error] [pid 216:tid 1668] [client ::1:58929] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 

可有人點我做錯了什麼?謝謝

+1

嘗試在rules.or的第二部分開頭刪除'。/'或者將您的rewritebase設置爲'/'。您還應該找到選項來設置放棄之前您的htaccess允許的最大重定向次數。 – Kinnectus

+0

感謝它的運作。我太愚蠢了。我嘗試刪除'/',但它不起作用,但我不想刪除'。/' – blitzen12

回答

2

從你的兩個RewriteRules中刪除./應該做的伎倆。