我在使用 justhost.com 帐户上的 .htaccess 文件时遇到问题。我不断收到内部 500 错误,并且我在网络上尝试了许多不同的解决方案。这是我的htaccess文件的样子:
根访问
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
应用程序/HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
app/webroot/HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
问题是我在错误日志中得到这个:
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.
我尝试将重写库设置为/,但它没有纠正问题。
您必须在三个 .htaccess 文件中使用 Rewrite base。根目录中包含目录app,lib,插件和供应商的那个应该看起来像
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
应用程序/htaccess应该看起来像
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
最后,应用程序/webroot/htaccess应该看起来像
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /app/webroot
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
如果您的 lib 不在根文件夹中,您还必须更改 core 中的值.php以将其映射到相关地址。为此,您可以在食谱中查看高级安装。
检查您的文件权限。
关闭您的 htacess 文件并写入 echo 1;exit; index.php并检查它是否显示天气。