.htaccess 500使用域名导航到Zend应用程序时出错

.htaccess 500使用域名导航到Zend应用程序时出错,.htaccess,zend-framework,dns,.htaccess,Zend Framework,Dns,我有一个托管在godaddy上的Zend应用程序,其域名指向保存该应用程序的子文件夹,使用该域名时会导致500服务器错误。我使用的是Linux主机,公用文件夹的路径是/subfoldername/public,这是域名指向的地方。令人困惑的是,当我导航到该站点时: 主机IP地址/子文件夹路径没有问题。使用域名进行导航时,错误日志中会生成以下内容: Request exceeded the limit of 10 internal redirects due to probable configu

我有一个托管在godaddy上的Zend应用程序,其域名指向保存该应用程序的子文件夹,使用该域名时会导致500服务器错误。我使用的是Linux主机,公用文件夹的路径是/subfoldername/public,这是域名指向的地方。令人困惑的是,当我导航到该站点时: 主机IP地址/子文件夹路径没有问题。使用域名进行导航时,错误日志中会生成以下内容:

Request exceeded the limit of 10 internal redirects due to probable configuration error.
环顾四周后,这似乎是一个.htaccess问题。我的公用文件夹中的.htaccess文件如下所示:

    RewriteEngine On
    # The following rule tells Apache that if the requested filename
    # exists, simply serve it.
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    # The following rewrites all other queries to index.php. The 
    # condition ensures that if you are using Apache aliases to do
    # mass virtual hosting, the base path will be prepended to 
    # allow proper resolution of the index.php file; it will work
    # in non-aliased environments as well, providing a safe, one-size 
    # fits all solution.
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::$
    RewriteRule ^(.*)$ - [E=BASE:%1]
    RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
第一条规则应该防止内部重定向,因此可能是最后一次路由到
index.php
的重写是错误的。尝试从以下位置更改它以简化路由:

RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
致:


如果
index.php
在另一个路径中,那么只需更改
/index.php
,使其指向正确的位置。

谢谢,这样做了。如果您不介意解释的话,我很好奇这个文件中发生了什么,以及为什么修复程序起作用。@mjtieman55我不太确定那里发生了什么,但它试图提取一个基本URI并将其附加到
index.php
前面。这些评论在某种程度上解释了这一点。
RewriteRule ^(.*)$ /index.php [L]