从codeigniter中的url中删除index.php
我试图从url中删除index.php。我尝试了更多的链接从林登,但没有工作。我试着跟着 1.add.htaccess文件,包含以下数据从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_
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。仍然面临错误