我为此被困了几个小时。我在网上找到了很多信息,但没有解决我的问题。
我使用自定义 PHP 安装(5.2.14)托管在 Dreamhost 上。该站点使用此 .htaccess 文件返回 500 内部服务器错误。
看起来重写规则也适用于我的 php.cgi 文件,但我不知道如何避免这种情况。
我的日志文件显示某处存在无限循环“由于可能的配置错误,请求超出了 10 个内部重定向的限制”。
<IfModule mod_actions.c>
Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
</IfModule>
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
应用程序/.htaccess :
RewriteEngine On
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
和 app/webroot/.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
任何帮助,将不胜感激!谢谢。