I have codeigniter installed in root/igniter folder.
under root/igniter, I have the following .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
Pages open just as I would expect them to without using 'index.php'.
So, my home page lies at http://example.com/igniter and my registration page at http://example.com/igniter/registration opens as well.
However, in my registration form, the submit button which is handled by a CI controller redirects to
http://example.com/igniter/index.php/registration
I have made sure that my config.php under applications/config has
$config['index_page'] = "";
This is what my Registration controller looks like:
public function index()
{
$this->load->helper(array('form', 'url'));
$this->load->model('Registration_Model');
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|callback_username_check|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[6]|max_length[12]|matches[passconf]');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|callback_email_check');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('registration');
}
else
{
//input data into database here
$username = strtolower($_POST['username']);
$password = md5($_POST['password']);
$email = strtolower($_POST['email']);
$data = array
(
'username' => $username,
'password' => $password,
'email' => $email
);
$this->Registration_Model->addUser($data);
$this->load->view('registrationsuccess');
}
}
As far as I can see, I am not explicitly asking the controller to redirect to index.php/registration.
action? You might want to show your view code.