dongzhi9457 2014-05-21 23:18
浏览 20
已采纳

.htaccess rewriterule 500内部错误

this might already exist but i can't seem to find out the answer after searching for a while now.

well this is what i want:

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

.htaccess file

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]

the problem is when I try access http://example.com/properties/1 while the first rewriterule is present I got 500 internal error. but when I try to remove or comment the first rewriterule everything is working fine.

or when I try to access http://example.com/agents/blitzen12 while the 2nd rewriterule is present I got the same error and it's working fine when I remove the 2nd rewriterule

apache full error logs

[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.

can someone point out what I did wrong? Thanks

  • 写回答

1条回答 默认 最新

  • duanguochong0397 2014-05-21 23:33
    关注

    Removing ./ from your two RewriteRules should do the trick.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?