Q:

Removing a index.php from codeginiter url using htaccess not working on server

.htaccess code: 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

also change in config file:
$config['index_page'] = ' ';

$config['uri_protocol'] = "REQUEST_URI";

mod_rewrite is also enabled.
although this code doesn't work.

A:

Change this
In 'config.php`
$config['base_url'] = '';
$config['index_page'] = ''
$config['uri_protocol'] = 'AUTO';

.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

and accessing URL should with base_url() function.
ex <form action="<?php echo base_url()?>Controller_name/Method_name"

Note: To use base_url() you have to enable it on autoload.php
$autoload['helper'] = array('url');

