我正在使用 Windows 7 64 位(也许这并不重要)并且我安装了 xampp。在我的 htdocs/ 目录中,我有多个项目。现在,对于其中一个(比如说 htdocs/test/),我创建了一个名为“example”的虚拟主机。这很好用......在 dir /test/ 我有带有以下代码的 .htaccess 文件:
RewriteEngine on
RewriteBase /test
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)\.(js|gif|jpeg|jpg|png)$
RewriteRule . index.php
在这里,我想将所有流量重定向到我的index.php
页面,因为我在这里使用我的一些系统来处理从索引页面开始的整个项目。在httpd.conf
,我启用了rewrite_module
,也在里面
<Directory "C:/Program Files/xampp/htdocs">
我已将AllowOverride
指令更改为All
.
现在,正如我所说,当我尝试使用创建的虚拟主机“示例”访问我的项目时,这可以正常工作。但是当我尝试访问我的 htdocs 目录中的其他项目时,我得到一个内部服务器错误 (HTTP 500) 并且在日志文件中出现这条消息:
[Thu Nov 15 11:07:12 2012] [error] [client 127.0.0.1] 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.
另外,如果我输入 URL127.0.0.1
或localhost
,我会用“示例”虚拟主机定义我的项目......这非常令人困惑,有人可以帮忙吗?