我的网站在服务器上运行良好,但是当我将以下代码添加到.htaccess文件时,它显示500服务器配置错误。
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_input_time 500
php_value max_execution_time 500
我的网站是使用Codeigniter创建的。我怎么能摆脱这个问题。
答案 0 :(得分:2)
始终检查是否启用了需要的模块
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
<IfModule mod_php5.c>
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_input_time 500
php_value max_execution_time 500
</IfModule>