【发布时间】:2017-09-20 19:11:08
【问题描述】:
你好朋友,我有像exam.example.com这样的子域,我需要从我的url中删除index.php,比如exam.example.com/index.php/controller/func_name
我在 config.php 中替换了以下内容
$config['index_page'] = 'index.php';
替换
$config['index_page'] = '';
并在我的项目中创建 .htaccess 文件并编写以下代码 -
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
【问题讨论】:
标签: .htaccess codeigniter