title: custom 404 error htaccess doesn't work on apache 2
body: <p>I've tried doing this with a .htaccess file on Apache and just couldn't get it to redirect to a custom 404 page. It would just keep on using the default apache 404 page.</p>
  
  <p>This is what I've done:</p>
  
  <p>I've put .htaccess file and a custom 404 file (page-not-found.php) into my home directory where index.php is.</p>
  
  <p>This is the line that's in .htaccess file:
  ErrorDocument 404 /page-not-found.php</p>
  
  <p>I also tried the full document path:
  ErrorDocument 404 /var/www/htdocs/page-not-found.php</p>
  
  <p>I've made sure that in '/etc/apache2/sites-enabled/default' and '/etc/apache2/sites-available/default' 'AllowOverride'  is set to 'All' as below:</p>
  
  <pre><code>    &lt;Directory /var/www/htdocs/&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride All
              Order allow,deny
              allow from all
      &lt;/Directory&gt;
  </code></pre>
  
  <p>I made sure that AccessFileName in httpd.conf is .htaccess</p>
  
  <p>I restarted apache after every change.</p>
  
  <p>None of this made it work, it still uses the default apache 404 file.
  Anoying thing is that this worked on a vritual site on the same server, but wouldn't work on the default site. Separate but same issue: I also can't get it to work on localhost on my own pc.</p>
  
  <p>(Arggghhhhhhh!!!!!!!!!!)</p>
  
  <p>What am I missing?</p>