url中没有index.php的CodeIgniter访问控制器

url中没有index.php的CodeIgniter访问控制器,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,访问控制器时,我想从url中删除index.php。 这是当前的工作url:http://localhost/jplugins/index.php/home/index/ 但当我使用url:http://localhost/jplugins/home/index/ 以下是我在stackoverflow上搜索时尝试的一些方法: 一,。设置$config['index_page']=“” 二,。htaccess,我已经尝试了在线程中找到的每个htaccess文件。。无效 三,。在xampp中启用重写

访问控制器时,我想从url中删除index.php。
这是当前的工作url:
http://localhost/jplugins/index.php/home/index/

但当我使用url:
http://localhost/jplugins/home/index/

以下是我在stackoverflow上搜索时尝试的一些方法:
一,。设置
$config['index_page']=“”

二,。htaccess,我已经尝试了在线程中找到的每个htaccess文件。。无效
三,。在xampp中启用重写模块
四,。设置
$config['base\u url']='http://localhost/jplugins/';也不起作用

五,。重新安装Xampp。不变
六,。更改
$config['uri_protocol']='AUTO'。我尝试了comment中列出的每一种方法,但不管查询是什么,它都只提供home/index输出,比如
http://localhost/jplugins/asdwhadsadasdasdasdadas/asdasda//asdad
-->将提供与
http://localhost/jplugins/index.php/home/index/

最后,我把我的全部代码发送给了一个也在使用xampp的人。它在那里工作得很好。使用相同的xampp版本3.2.1(2013年5月7日)。
我使用的是32位windows 7。

这里可能有什么问题?

jplugins
目录中创建一个
.htaccess
文件,并添加以下代码:

RewriteEngine On

RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

您是否在apache虚拟主机上设置了正确的允许/拒绝指令以使用.htaccess?是否需要设置该指令?另一个人在stock xampp设置上尝试了我的代码。视情况而定,可能会尝试比较两种配置的vhost文件,以查看是否存在任何差异,以便您将其排除在罪魁祸首之外。此问题的解决方案对您有效吗?-在添加line RewriteBase/jsplugins之后。输出仍然是一样的。使用htaccess从下面的答案重定向到带有htaccess的xampp页面。当我打开它时,它会重定向到非常奇怪的。。。如果你用另一个程序运行你的代码,比如?问题可能是您没有在根目录下运行代码。并且您的
.htaccess
?在CodeIgniter中,是否设置了默认控制器?$route['default_controller']='home';和$route['assets/(:any)]='assets/$1';在位于config中的routes.php中