Non-existent PHP files


#1

Hi!

When i go to http://www.mysite.com/nonexist.php instead of 404 error I get 200 with “No input file specified.”

Is this a bug or feature? :slight_smile:

Nick


#2

A feature of-course! :wink:

Seriously though, I believe this is caused by the fact that PHP is running as CGI. The workaround I use is to add the following to the .htaccess file for the domain and create a custom 404.php file.

[color=#0000CC]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /404.php [L][/color]

Mark

–
Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)