我下载并安装了XAMPP,并保持我的项目很好地分开,我想根据它的未来域名为每个项目创build一个VirtualHost。 例如,在我的第一个项目(我们会说它是project.com ),我把它放在我的Apacheconfiguration中:
NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1:80> DocumentRoot C:/xampp/htdocs/ ServerName localhost ServerAdmin admin@localhost </VirtualHost> <VirtualHost 127.0.0.1:80> DocumentRoot C:/xampp/htdocs/sub/ ServerName sub.project.com ServerAdmin [email protected] </VirtualHost> <VirtualHost 127.0.0.1:80> DocumentRoot C:/xampp/htdocs/project/ ServerName project.com ServerAdmin [email protected] </VirtualHost>
这在我的主机文件中:
# development 127.0.0.1 localhost 127.0.0.1 project.org 127.0.0.1 sub.project.org
当我在浏览器中访问project.com时,项目成功加载。 同样如果我去sub.project.com 。 但是,如果我导航到: http://project.com/register : http://project.com/register (我的网站页面之一),我得到这个错误:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
错误日志显示这个:
[Sun May 20 02:05:54 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., referer: http://project.com/ Sun May 20 02:05:54 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., referer: http://project.com/
任何想法什么configuration项我得到错误或如何得到这个工作? 它发生在任何不在project.com根目录中的页面上。 谢谢。
如错误消息所示,在根文件夹,DocRoot文件夹或其中一个子文件夹的.htaccess文件中,存在不正确的RewriteCond / RewriteRuleredirect。
它正在自行循环,经过10次内部redirect,Apache正在为了保护进程而将其杀死。
您的文档根目录重叠。 例如文件C:/xampp/htdocs/sub/index.php将成为你的前两个虚拟主机的一部分。 尝试:
DocumentRoot C:/xampp/htdocs/default/ DocumentRoot C:/xampp/htdocs/sub/ DocumentRoot C:/xampp/htdocs/project/