1and1 htaccess文件不起作用 [英] 1and1 htaccess file not working

查看:70
本文介绍了1and1 htaccess文件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地主机上创建了一个网站,并将其上传到我的1and1.co.uk帐户,但出现500个内部服务器错误。

I've created a website on my localhost and having uploaded it to my 1and1.co.uk account, I'm getting a 500 internal server error.

php_flag display_errors on
php_value error_reporting 9999

RewriteEngine On
RewriteBase /mvc/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

这是本地主机上htaccess文件的内容,它导致500个内部服务器

This is the contents of the htaccess file on localhost and it's causing a 500 internal server error now.

有什么想法吗?

推荐答案

替换这些行:

php_flag display_errors on
php_value error_reporting 9999

在共享托管环境中经常禁止设置php_flag和php_value。请将以下行添加到index.php的开头:

Setting php_flag and php_value is regulary forbidden in shared hosting environment. Add the following lines to the begin of your index.php instead:

ini_set('display_errors', 'on');
ini_set('error_reporting', E_ALL);

顺便说一句,我看到您正在使用 error_reporting 9999 级别。这对我来说很奇怪。请注意, error_reporting 不是一个整数值,可以将其递增以输出更多错误,而是一个位字段。请参考手册

Btw, I see that you are using an error_reporting level of 9999. This looks weired to me. Note that error_reporting isn't an integer value that can be incremented to output more errors, it is a bitfield instead. Refer to the manual.

这篇关于1and1 htaccess文件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆