[英]error 500 Cakephp 3 in subfolder with OVH
我在開發服務器上開發了基於Cakephp 3的Web應用程序。 現在我想上線。 所以我將cakephp文件夾上傳到我的新服務器,其架構如下:www / site
現在,當我嘗試使用服務器的地址時,例如: http : //test.cluster.ovh.net/site,它的工作正常。
但是,當我嘗試在子文件夾www / site上以ovh成員區域作為目標域( http://test.com和www.test.com)時,cakephp應用程序顯示內部服務器錯誤500。
這是我在cakephp中的基本.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ site/webroot/ [L]
RewriteRule (.*) site/webroot/$1 [L]
</IfModule>
錯誤日志:
[2016年3月22日22:07:26] [錯誤] [客戶端xx.xxx.xx.xx] [host test.cluster.ovh.net]由於可能的配置錯誤,請求超出了10個內部重定向的限制。 如有必要,使用'LimitInternalRecursion'增加限制。 使用“LogLevel debug”獲取回溯。
我該怎么辦?
謝謝!
編輯:此處找到解決方案: 請求超出了10個內部重定向的限制
您需要排除您正在重寫的目標,否則您將收到重寫循環錯誤,因為site/webroot/
也匹配重寫模式(.*)
。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/site/webroot
RewriteRule (.*) site/webroot/$1 [L]
</IfModule>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.