Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter URL Redirect WITHOUT adding index.php

Tags:

I'm working on a site with a few controllers, and have configured my server to redirect requests for http://www.host.com/controller/function/params tohttp://www.host.com/index.php/controller/function/params using some simple regular expression matching in the apache config. Now, I am trying to get one of my controllers to redirect to another one, but without adding the index.php to the URL, which is what the redirect() function does. Is there an easy way to do this in codeigniter? Thanks beforehand!

like image 692
SuperTron Avatar asked Feb 29 '12 02:02

SuperTron


1 Answers

You can use redirect. It only adds index.php if it is configured as your index page.

So, check your index_page configuration. It should be an empty string:

$config['index_page'] = ''; 

File: app/config/config.php

More info: http://www.codeigniter.com/user_guide/general/urls.html?highlight=mod_rewrite [Updated Version]

like image 155
J. Bruni Avatar answered Sep 22 '22 16:09

J. Bruni