1and1 htaccess file not working

眉间皱痕 提交于 2020-01-14 04:20:50

问题


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]

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

Any ideas?


回答1:


Replace those lines:

php_flag display_errors on
php_value error_reporting 9999

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);

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.



来源:https://stackoverflow.com/questions/16429977/1and1-htaccess-file-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!