Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从codeigniter中的url中删除index.php_Php_.htaccess_Codeigniter - Fatal编程技术网

从codeigniter中的url中删除index.php

从codeigniter中的url中删除index.php,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我试图从url中删除index.php。我尝试了更多的链接从林登,但没有工作。我试着跟着 1.add.htaccess文件,包含以下数据 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] 2.在config.php$config['index_page']=''中更改 3.激活mod_

我试图从url中删除index.php。我尝试了更多的链接从林登,但没有工作。我试着跟着

1.add.htaccess文件,包含以下数据

 RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$0 [PT,L]
2.在config.php
$config['index_page']=''中更改

3.激活
mod_rewrite


但仍然不工作。

请更换您的htaccess代码

RewriteEngine on 
RewriteBase /yourfolder/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt) 
RewriteRule ^(.*)$ /yourfolder/index.php/$1 [L] 

在项目目录的根目录中创建.htaccess文件,包含以下内容:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
使用以下内容修改application/config/config.php:

 $config['index_page'] = '';

最后,以下代码在.htaccess文件中工作

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

可能是阿伦的复制品。我尝试了指向的链接,但不起作用。您是在本地还是在服务器中尝试?在此服务器上找不到请求的URL/ci/controller/functionname。仍然面临错误