Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

By specifying SetHandler application/x-httpd-php5 on all requests, you are preventing mod_dir from doing its job.

I think this would work:

DirectoryIndex index index.php index.html
<Files *>
  SetHandler application/x-httpd-php5
</Files>
share|improve this answer
add comment

Options -MultiViews

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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