没有index.php的Codeigniter重定向

时间:2015-09-11 04:52:56

标签: php .htaccess codeigniter

我在我的WAMP中使用codeigniter 2.4。每次我设置$config['index_page'] = ''时,codeigniter都找不到控制器方法。当我将其设置回$config['index_page'] = 'index.php'时,它可以再次找到该方法。我想摆脱index.php,以便我的ajax调用可以正常工作。

以下是我的配置文件:

**.htaccess:**

RewriteEngine on 
RewriteBase /mca-backend
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

**config.php**

$config['index_page'] = '';

我有一个类将请求重定向到另一个类方法,这里是代码:

redirect('auth/login', 'refresh');

当重定向代码被调用时会发生这种情况,我很确定我的WAMP apache上的rewrite_module已打开。

任何人都可以帮助我吗?非常感谢你。

0 个答案:

没有答案