Rendering extension-less files with php creates 404 errors when accessing the directory index

Posted by ojcar on Server Fault See other posts from Server Fault or by ojcar
Published on 2010-04-13T16:39:55Z Indexed on 2010/04/13 16:43 UTC
Read the original article Hit count: 360

Filed under:
|

I'm trying to render all files in a directory as php files. These files don't have any extension. I do this by adding the following .htaccess file:

SetHandler application/x-httpd-php5
DirectoryIndex index index.php index.html

The problem is that I'm getting 404 errors when accessing the index file on a url. For instance http://foo.com/mydir/ will result in a 404 error (in the logs) and a "No input file specified" message in the browser.

If I remove the SetHandler line things work correctly for the index file but my other pages do not render as php.

PHP 5.2.11 Apache 2.2.14 Linux

Any ideas of what I'm doing wrong?

© Server Fault or respective owner

Related posts about apache

Related posts about php