.htaccess issues: No input file specified

I was beating my head up against this as well. I'm also installing Code Igniter.

The goocher was no RewriteBase. Here's my .htaccess:

DirectoryIndex index.php

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)

RewriteRule ^(.*)$ index.php?/$1 [L]

The Problem

I encountered a similar problem just now and unfortunately none of the answers in this thread helped:

Zend Framework was giving out "No input file specified.", but:

  • The default RewriteBase was just fine, and adding RewriteBase / did not help
  • It's a shared hosting server and only FastCGI is available (no ability to switch to SuPHP)
  • AcceptPathInfo was on
  • There was no problem with URL rewriting in general on the server

So the answer came from the following site: https://ellislab.com/forums/viewthread/55620/P15 [dead link] (even though the host is not DreamHost).

The Solution

Apparently all you need to do is replace this line:

RewriteRule ^(.*)$ index.php/$1

With this:

RewriteRule ^(.*)$ index.php?/$1

Problem solved.


This worked for me:

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

After index.php, the question mark is important!