Resolving the CodeIgniter “No Input File Specified” Error

November 16th, 2010 - Posted by Steve Marks to PHP, Web Development.

A site that I work with that is built on the CodeIgniter framework today started showing the error “No Input File Specified” when visiting any page other than the homepage. The cause wasn’t immediately available as I’d never seen this error before. It also wasn’t your average PHP error so I had to dig a bit further. After a while I came across a possible solution that, after trying, seemed to do the trick.

The Solution

The error wasn’t in my actual code (that’s what a developer likes to hear!), but was rather to do with the .htaccess file for my site. I’ve included below the part of my .htaccess file I had to change to get this to work correctly:


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


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

Spot the difference? Note the question mark following ‘index.php’ in the second snippet. In adding this my site now worked as expected. Why this changed randomly I’ll never know but I hope this helps if you find yourself in the same situation.

This entry was posted on Tuesday, November 16th, 2010 at 8:37 pm by +Steve Marks and is filed under PHP, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (18)
  1. Mraka says:

    Thank you very much. I have same problem with codeigniter on iPage and only you post give me solution :)

  2. Marcelo Goebel Machado says:

    Thank you! It works!

  3. Marcelo says:

    Excellent, thank you very much! I need this solution!!! Thanks!

  4. Thank you very much! Excellent solution!!!

  5. jfrazzle says:

    Awesome! Thanks! What a crazy find!

  6. Anonymous says:

    tattai solution

  7. cark says:


  8. quoc dat says:

    Thanks a lot it

  9. Nuajan says:

    You save my life, man. THX

  10. Andre says:

    Thanks a bunch!

  11. HSS says:

    Thanks a lot it .
    It was a bulls eye

  12. labidi says:

    Thanks, you just saved my life LoL

  13. Ronaldo says:

    Thak you a lot.

  14. shree says:

    Thanks mate. It also work with me :)
    Cheers !!! Happy Coding

  15. Alan Nicolas Souza says:


    This solved my problem.

  16. Hari says:

    Thank u very much…….

  17. Matt says:

    this worked awesome.


  18. Hi,

    This was pretty easy to resolve, but to hard to find how to make it work after you have made necessary changes. First upload the .htaccess file into your root CodeIgniter folder (system) and also into your root folder.

    After you make all these changes ensure to check with the following

    It should work..

    Thanks for the suggestions.
    -Vijayanand Gurudev