Codeigniter无法从url中删除索引

Wel*_*ays 2 php codeigniter centos

我正在使用CentOS,

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|resources)
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteBase /var/www/html/site/

</IfModule>
Run Code Online (Sandbox Code Playgroud)

但同样的问题我的index.php页面工作正常,但当我删除index.php它不工作...

ABo*_*rty 6

我认为它会帮助你,因为我正在使用这个.将此代码放在根文件夹的htaccess文件中.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Run Code Online (Sandbox Code Playgroud)

如果它正常工作,请告诉我.