问题
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