我使用 CakePHP 2.0 作为我的网站框架,我在服务器上找到了 cakephp 文件,但我遇到了一些问题,名为服务器内部错误 500,我不知道我应该做什么,其他页面运行良好,但是有些页面遇到了 500 服务器内部错误,我检查了 Controller , View ,模型,他们说没有检测到错误,但是 firebug 说, View 丢失了,这是我的 .htaccess
文件
public_html/cakephp/
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /~magang/smkn1pst/
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
public_html/cakephp/app
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
public_html/cakephp/app/webroot
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~magang/smkn1pst/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
我已经按照步骤进行操作,将 /
ex: app/webroot/添加到/app/webroot/并将 webroot/添加到/webroot/但对我来说仍然不起作用,我需要继续下一个项目,但这个问题困扰着我。
最佳答案
您正在使用 mod_userdir,使用它时确实需要 RewriteBase,因为 mod_rewrite 会删除 ~ 字符
RewriteBase /~magang/smkn1pst
所有 3 个 .htaccess 文件都应该可以工作,就像我一样
当前您的一个文件缺少这一行
关于php - CakePHP 2.0 上的服务器内部错误 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11715527/