在codeigniter中指定的htaccess

I have some problem in .htaccess in codeigniter

it will generate the error No input file specified and my url are http://cg.alpcube.com/index.php/home/register if i remove index.php then it will work perfectly

And my .htaccess file are as under

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1 

How can i remove index.php from url

On your codeigniter folder add .htaccess and add this

RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

suppose your project name is Example now in the project folder there will be a file .htaccess

<ifModule mod_rewrite.c>
# Turn on the engine:
RewriteEngine on
# Don't perform redirects for files and directories that exist:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For everything else, redirect to index.php:
RewriteRule ^(.*)$ index.php/$1
</ifModule>

write this into the .htaccess file

now just run this command

sudo a2enmod rewrite

and then restart your web server

sudo service apache2 restart
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Add this in the .htaccess which must be located at root of your project :

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