Ok, things are getting confusing because I'm trying a dozen different combinations of things. So I will try to be systematic. For all these cases, I'm entering a 100% non-existing URL:
http://domain.net/dfvdfv/Also, I want to mention that this is for an add-on domain.
1. With a completely blank .htaccess I get the standard Firefox 404 Not Found page for the non-existing page. However, I also get a 404 Not Found for all existing pages except for the front page (index).
2. The default WordPress .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I get the evil Compilation Page, and all my pages load properly (Sidebar links, etc).
3. I've seen at least a dozen different sites, including Wordpress.org, say that adding ErrorDocument 404 /index.php?error=404 to the .htaccess will make WordPress look for the 404.php file in the template folder (which I have - it's a copy of my index.php with the Loop removed).
ErrorDocument 404 /index.php?error=404
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This still returns the evil Compilation Page, and all the pages load fine.
4. At this point, I'll mention that manually entering
http://domain.net/index.php?error=404 redirects to the front page (which is a WordPress default action, though it's completely ignoring my 404.php file).
5. So I created a super-simple html file and placed it in my root directory.
<HTML>
<HEAD>
<meta name="robots" content="noindex">
<TITLE>404 Page Not Found</TITLE>
</HEAD>
<BODY>
<h2>Sorry, the page you're looking for can't be found</h2>
</BODY>
</HTML>
And this file loads fine:
http://domain.net/404error.html6. Now I tried to add this to the .htaccess
ErrorDocument 404 /404error.html
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
And yet again I get the evil Compilation page, with all the other pages loading fine.
7. I removed the WordPress rewrite section again
ErrorDocument 404 /404error.html
And the new html page displays for the non-existing URL, but all of the other pages (Sidebar links) return a 404 now.
8. So there are 2 basic outcomes right now: either I get the evil Compilation page and all my pages load; or the 404.html displays, but all of my legit pages become 404 errors.
I'm leaving the site set up with
ErrorDocument 404 /404error.html
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
So you can see how bizarre the evil Compilation page is.