尝试从codeigniter中的URL中删除index.php [英] Trying to remove index.php from URL in codeigniter
本文介绍了尝试从codeigniter中的URL中删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要从网址中移除「index.php」。我尝试过
I am trying to remove 'index.php' from the URL. I have tried by making
$config['uri_protocol'] = 'AUTO';
为
$config['uri_protocol'] = 'REQUEST_URI';
和
$config['index_page'] = 'index.php';
为
$config['index_page'] = '';
甚至尝试使用
RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /project/index.php/$1 [L]
,但它不工作我。任何人都可以告诉我在哪里我错了?
提前感谢..
in .htaccess file, but it not working me. Can anyone please tell me where I am going wrong? Thanks in advance..
推荐答案
得到答案,我刚刚在我的.htaccess文件中插入了以下代码:
Got the answer, I just had inserted the following code in my .htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
b $ b $ config ['index_page'] ='';
.php
in config.php
源:删除index.php来自URL - Codeigniter r
回答者:@Akhilraj N S
Answered by: @Akhilraj N S
这篇关于尝试从codeigniter中的URL中删除index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文