0

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

lighter
  • 2,808
  • 3
  • 40
  • 59
  • possible duplicate of [No input file specified](http://stackoverflow.com/questions/14555996/no-input-file-specified) – FBHY Dec 06 '13 at 09:33

4 Answers4

0

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]
lighter
  • 2,808
  • 3
  • 40
  • 59
0

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
Let me see
  • 5,063
  • 9
  • 34
  • 47
0
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
sharafatalee
  • 134
  • 3
0

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]
tcj
  • 1,645
  • 4
  • 13
  • 21