.htaccess codeigniter中的index.php重定向问题

.htaccess codeigniter中的index.php重定向问题,.htaccess,codeigniter,redirect,.htaccess,Codeigniter,Redirect,我已经使用plesk cpanel部署了我的codeigniter项目。我已经通过修改配置文件删除了index.php,同时更新了我的.htaccess文件。当我尝试登录时,会发现404错误页面未找到。它在本地主机上运行良好,但在live server上出现错误。这是一个SSL安全站点 我的配置文件代码: $config['base_url'] = 'mydomain'; /* |---------------------------------------------------------

我已经使用plesk cpanel部署了我的codeigniter项目。我已经通过修改配置文件删除了index.php,同时更新了我的.htaccess文件。当我尝试登录时,会发现404错误页面未找到。它在本地主机上运行良好,但在live server上出现错误。这是一个SSL安全站点

我的配置文件代码:

$config['base_url'] = 'mydomain';

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI'    Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING'   Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO'      Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
My.htaccess文件代码:

$config['base_url'] = 'mydomain';

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI'    Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING'   Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO'      Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
plesk cpanel有什么问题吗?或者我的代码有问题。因为我已经在我的其他主机上部署了这个项目,它在那里工作得很好。问题就在这个主机上


谢谢。

我通过在生产服务器上显式设置“https”解决了这个问题:
$config['base\u url']='https://example.org/';