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

We are hosting several sites on our server. We have set a custom not_found.php file in the apache config and it works fine.

For a few of our virtual hosts, we need a custom not_found.php file. In the <VirtualHost> section we have set a custom 404 file. When we try to access a non-existing url in that virtual host, we get a "File not found" error (not the typical Firefox 404 Not Found).

If we rename the file to .html and change it to .html in the config, it loads the custom 404 just fine (the PHP scripting doesn't work of course). So I know it is reading the custom ErrorDocument statement in the VirtualHost. And I know the path is fine. It just doesn't work with an extension of .php.

Here is the relevant config:

<VirtualHost>
    Alias "/error_docs" "/var/www/vhosts/domain.com/error_docs"
    ErrorDocument 404 /error_docs/not_found.php
</VirtualHost>

PS. PHP scripts work throughout the sites (so we know PHP is working fine).

Any ideas?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I figured this out. Someone had specifically turned off PHP for the error_docs folder using

php_admin_flag engine off

It was hidden away and I just happened to find it today.

share|improve this answer

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.