dongzhi9457 2014-05-22 07: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-22 07:33
    关注

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

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

报告相同问题?

悬赏问题

  • ¥18 模拟电路问题解答有偿
  • ¥15 Matlab在app上输入带有矩阵形式的初始条件发生错误
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题