Can someone help me with this. I'm feeling like I've been hitting my head against a wall for over 2 hrs now.

I've got Apache 2.2.8 + PHP 5.2.6 installed on my machine and the .htacces with code below works fine, no errors.

RewriteEngine on
RewriteCond $1 !^(index\.php|css|gfx|js|swf|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

The same code on my hosting provider server gives me a 404 error code and outputs only: No input file specified. index.php IS there. I know they have Apache installed (cannot find version info anywhere) and they're running PHP v5.2.8.

I'm on windows xp 64-bit, they're running some Linux and php in cgi/fastcgi mode. Can anyone suggest what could be the problem?

PS. if that's important that's for CodeIgniter to work with friendly URLs.

link|improve this question

71% accept rate
feedback

5 Answers

up vote 1 down vote accepted

turned out I needed RewriteBase:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|css|gfx|js|swf|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]
link|improve this answer
feedback
  1. Double-check the newline endings. Apache is kind of picky about them in .htaccess.
  2. Turn off multiviews in .htaccess (Options -Multiviews) as read in Sheepdog IT
  3. You can always learn more about your environment using the phpinfo() function
link|improve this answer
Given that this is an Apache related problem, reading the output of phpinfo() will only serve to be a waste of time. – rodjek Nov 30 '09 at 21:45
That would certainly help to get information about the Apache server version: "I know they have Apache installed (cannot find version info anywhere)"... – codehead Nov 30 '09 at 23:53
feedback

I ran into the same problem trying to configure a friendly URL for my CodeIgniter project. I finally figured it out. Let's take a look at my apache2 configuration:

<Directory /home/hai/www>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

The problem is at the line that said AllowOverride None. Change None to All and it works:

<Directory /home/hai/www>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Update: My system info:

  • Server: Xubuntu 9.x (practically same as Ubuntu)
  • Apache: version 2.2
  • The configuration in question is in /etc/apache2/sites-available/default

By the way, I am new to web design, php, and CodeIgniter (I just started php last week and CodeIgniter yesterday), so please kindly point out any mistake in my answer.

Update2: If afterward you get error code 500 instead of 404. It means you don't have the rewrite module enabled. Issue the following command to fix it:

$ sudo a2enmod rewrite
link|improve this answer
feedback

Are you using mod_php or CGI PHP? If you try to load /index.php/something directly from your browser do you still get "No input file specified"? I have seen this before with FCGI PHP and appending paths to PHP files (like /index.php**/something**)

link|improve this answer
feedback

http://pankajdangi.com/2010/04/no-input-file-specified-codeigniter/

You will get what you want.

Cheers

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.