I'm having trouble with doing custom error messages in Apache.

I've read Apache documentation and basic syntax is quite clear and simple. Only problem I'm having is I don't know in what config file I should put them. It's also hard to understand older questions about same subject due different config system it was before.

My .htaccess (I don't know if this is needed, I do have full control of server)

RewriteEngine on
ErrorDocument 404 /404.html

if you need something else, please tell and I'll get them

Edit: I'm running on Ubuntu Server 14 LTS and Apache 2.4.7


  • I've enabled rewrite module
  • /etc/apache2/sites-available/default looks like:

    <Directory /var/www/> Options Indexed FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>

  • I tried How To Create A Custom ErrorDocument Page In Ubuntu 14.04? but it isn't working.
  • I've restarted apache after every change
  • My files are 404.html index.html and .htaccess and they are all at /var/www/html
  • Tried Enable use of .htaccess in apache2 still not working
  • Rewrite Engine on -> RewriteEngine on – madneon Mar 26 '15 at 11:39
  • @madneon fixed & restarted -> no change, so still not working – egws Mar 26 '15 at 13:40

like in Apache Doc:

Custom error documents are configured using the ErrorDocument directive, which may be used in global, virtualhost, or directory context. It may be used in .htaccess files if AllowOverride is set to FileInfo.

So it should be okay in .htaccess Files. Did it work for you?

  • My .htaccess file is above – egws Mar 26 '15 at 7:00
  • I see a typo: "Enginge" should be "Engine". – Jos Mar 26 '15 at 7:02
  • @Jos Fixed that, still not working – egws Mar 26 '15 at 7:17
  • Anything useful in /var/log/apache2/error.log? – Jos Mar 26 '15 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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