Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create 404 error pages but it should be usable for all of users, If I use ErrorDocument 404 /404.php it will display "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." on users web site, How to create it without placing 404.php in every users documentroot?

share|improve this question

migrated from Aug 2 '09 at 6:41

This question came from our site for professional and enthusiast programmers.

You could configure your apache with rewrite rule as above:

ErrorDocument 404
# or maybe .php if you want some smarts in that page?

but also put a system-wide alias in place for the /customerrors/ path

Alias /customerrors /var/www/html/custom-errors/
<Directory /var/www/html/custom-errors/>
  # make sure the location can be used to serve files
  Order allow,deny
  Allow from all

You'll just have to be a little careful to not override a website-local URL.

share|improve this answer

Configure your apache with rewrite rule

ErrorDocument 404
share|improve this answer
thank you for fast response :) but it will redirect all users 404 to is there a way to not redirect to other domain but stay in users domain? – Anonymous Jun 2 '09 at 11:53

Your Answer


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