Codeigniter 产品在没有 index.php 的情况下在本地服务器中运行良好但在服务器中不起作用

Codeiginter product worked well in localserver without index.php but not worked in server

我已经在 codeigniter 中创建了一个项目

在没有 index.php (localhost/sample) 的情况下在本地服务器上工作 但是当我升级到在线服务器(cpanel linux)时,默认控制器只工作,其他下一页 URL 不工作.. (https://sample/nextpage)

如果我给出 index.php 表示有效 (https://sample/index.php/nextpage)

我想删除 index.php ,请帮帮我..

我的config.php

$config['index_page']   = 'index.php';
$config['uri_protocol'] = 'REQUEST_URI';

我的route.php文件

$route['default_controller'] = "pages/home";
$route['pages/profile'] = "pages/profile"; 
$route['creators'] = "pages/userList";
$route[$username] = "pages/userList/userview/"; 

$route['translate_uri_dashes'] = FALSE;
$route['404_override'] = '';

我的 .htaccess 文件

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/[=13=] [PT,L] 
Options All -Indexes 

提前致谢,

施鲁西。

尝试使用以下内容更改 .htaccess 文件的代码

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]

更改 .htaccess 文件

  RewriteEngine On
  RewriteBase /name of project folder 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/ [L]

试试这个

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/ [L]
RewriteCond  !^(index\.php|img|css|public|tmp|download|javascript|rte|document|xajax_js|robots\.txt)

请联系您的托管服务提供商并检查 mod_rewrite 模块是否启用?