尝试从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