Answer by Mitchell McKenna for codeigniter use of redirect()

September 2 2010, 12:07am

It's bad practice to use redirects like that; you're basically doubling the # of server requests.

If you don't want to have the function names in the URL, just have the form POST to the controller index() function, and call the function you need based on some criteria such as what was passed from the forms POST data:

<form action="myapp.com/controller_name" method="post">

Controller:

function index(){ if(!empty($_POST['some_form_data'])){ $this->page_feature(); } else{ $this->load->view('page'); } } function page_feature(){ /* some stuff */ $this->load->view('page_feature'); }

You may also want to check out the _remap() function. That way additional uri segments are not treated as function calls.