.htaccess CodeIgniter项目在上载在线服务器时显示错误

.htaccess CodeIgniter项目在上载在线服务器时显示错误,.htaccess,codeigniter,.htaccess,Codeigniter,.httaccess代码在此处: RewriteEngine on RewriteBase / RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L,QSA] AddDefaultCharset utf-8 我的项目在本地主机上运

.httaccess代码在此处:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]
AddDefaultCharset utf-8
我的项目在本地主机上运行良好,但当我在主机服务器上上载项目时,它显示错误。图中提到了错误。
我在上面附上了我的.htacces文件,请参考。

.httaccess如下:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
并像下面的代码一样设置config.php:

//$config['base_url'] = '';
$config['base_url'] = ((isset($_SERVER['HTTPS']) &&       $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

您是否在
application/config/config.php
中更改了
$config['base\u url']
$config['index\u page']
以匹配您的主机设置?是的。我已经更改了这些设置:$config['base\u url']=''$配置['index_page']='';弗里德里希·韦伯,请帮忙