删除CodeIgniter中的index.php

问题描述:

我试图从CI网址中删除index.php。

I'm trying to remove the 'index.php' from CI Urls.

我尝试过很多解决方案,但没有一个工作。我已经在config.php中设置这些变量:

I've tried many solutions, none of them worked. I've already set these variables in 'config.php':

$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";

我目前的.htaccess是:

And my current .htaccess is:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^plugb.com$ [NC]
RewriteRule ^(.*)$ http://www.plugb.com/$1 [R=301,L]

RewriteCond $1 !^(index\.php|files|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

www前缀部分工作正常。但是'index.php'部分没有。如果您要检查网页,请访问以下网址: http://www.plugb.com/ index.php / home

The www prefix part works fine. But the 'index.php' part doesn't. If you want to check the webpage, here is it: http://www.plugb.com/index.php/home

//codeigniter.com/user_guide/general/urls.htmlrel =nofollow noreferrer> URL部分中的删除index.php文件下的CodeIgniter用户指南 。

There's instructions on how to do this in the URLs Section of the CodeIgniter User Guide under the section "Removing the index.php file".