Sup*_*ron 17 apache redirect codeigniter
我正在一个有几个控制器的站点上工作,并且已经将我的服务器配置为重定向请求,http://www.host.com/controller/function/params以便http://www.host.com/index.php/controller/function/params在apache配置中使用一些简单的正则表达式匹配.现在,我试图让我的一个控制器重定向到另一个,但没有添加index.php到URL,这是该redirect()功能的作用.在codeigniter中有一个简单的方法吗?先谢谢!
J. *_*uni 74
你可以用redirect.只有在将index.php其配置为索引页面时才会添加.
因此,请检查您的index_page配置.它应该是一个空字符串:
$config['index_page'] = '';
Run Code Online (Sandbox Code Playgroud)
文件: app/config/config.php
更多信息:http://www.codeigniter.com/user_guide/general/urls.html? highlight = mod_rewrite [更新版本]