2013-04-10 22 views
0

我有一個Zend應用程序託管在godaddy上,域名指向持有應用程序的子文件夾,導致使用域名時出現500服務器錯誤。我正在使用Linux主機,公用文件夾的路徑是/ Subfolder Name/public,這是指向域名的地方。令人困惑的是,當我通過以下方式導航到站點時: 主機IP地址/子文件夾路徑沒有問題。當導航使用該域名下面的錯誤日誌中產生:使用域名導航到Zend應用程序500錯誤

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] 

回答

1

第一條規則是應該防止內部重定向,所以它可能是最後一次重寫路線index.php是錯的情況。試着改變它從簡化路由:

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

到:

RewriteRule ^(.*)$ /index.php [L] 

如果index.php是另一個路徑,則只需改變/index.php使之指向正確的地方。

+0

謝謝,這是做到了。如果你不介意解釋,我很好奇這個文件中發生了什麼,以及修復工作的原因。 – mjtieman55 2013-04-10 23:43:52

+0

@ mjtieman55我不完全確定那裏發生了什麼,但它試圖提取一個基本URI並將其附加到'index.php'前面。評論有點解釋它。 – 2013-04-10 23:53:46

相關問題