ci隐藏index.php的方法:首先打开【rewrite_module】,并修改AllowOverride none为AllowOverride All;然后在CI的目录下面创建【.htaccess】文件并添加相关内容;最后相关内容即可。
ci隐藏index.php的方法:
1.需要apache打开rewrite_module
,然后修改httpd.conf的AllowOverride none为AllowOverride All(里面,不同的环境目录不同)
2.在CI的目录下面创建.htaccess
文件,加入如下内容:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond $1 !^(index\\.php|images|robots\\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
3.修改config.php的内容:
$config['index_page'] = 'index.php';
替换为
$config['index_page'] = '';
相关学习推荐:php编程(视频)
The above is the detailed content of How to hide index.php in ci. For more information, please follow other related articles on the PHP Chinese website!