删除CodeIgniter中的index.php [英] Remove index.php in CodeIgniter
问题描述
我试图从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".
这篇关于删除CodeIgniter中的index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!