且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从codeigniter中的URL中删除index.php?

更新时间:2023-02-21 22:15:08

尝试以下规则:

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

在您的 config.php 文件中,

//Find   
$config['index_page'] = "index.php" 
//and replace it with
$config['index_page'] = ""