我的网站框架使用CakePHP 2.0,我在服务器上找到了我的CakePHP文件,但我遇到了一些问题,名为"服务器内部错误500",我不知道该怎么办,其他页面运行良好,但有些页面遇到了500服务器内部错误,我检查了控制器、视图、模型,他们说没有检测到错误,但firebug说,视图不见了,这是我的.htaccess
文件
public_html/cakehp/
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /~magang/smkn1pst/
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
public_html/cakehp/app
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
public_html/cakehp/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/to/app/webroot/和webroot/to_webroot/,但仍然不适用于我,我需要进入下一个项目,但这个问题困扰着我的一天。
您正在使用mod_userdir,当使用它时,您确实需要RewriteBase,因为mod_rewrite删除了~character
RewriteBase /~magang/smkn1pst
在所有3.htaccess文件中都应该工作,就像它对我所做的那样
目前,您的一个文件缺少这一行
这将有助于修复您的错误。
http://ask.cakephp.org/questions/view/getting_http_1_0_500_internal_server_error_in_my_cakephp_website
我不确定请尝试
RewriteBase /smkn1pst/
我也遇到了类似的问题(静态文件在根htaccess中使用正确的RewriteBase正确重定向)。
事实证明(经过4个小时的调试.htaccess),由于我自己添加了一条规则,我的FTP客户端跳过了app/tmp/目录。
这也产生了500个错误。