You get a white screen with "No Input File Specified"

When using http://site.com/query1/query2/ type of URLs that rewrite to http://site.com/index.php/query1/query2/ with mod_rewrite and PHP you might get a "No input file specified" error. There is a simple workaround, and it is to add a question mark to the the .htaccess right after the file you want to send the query strings to, as such:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

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

That forces Apache to consider everything after index.php as a query string. This is known to fix broken pretty URLs for MediaWiki, CodeIgniter, ExpressionEngine and a few other major scripts.

  • 12 Users Found This Useful