title: How to redirect to 404 error page via JavaScript?
body: <p>The site consists of index.php only and content changes via JavaScript, when ever I type in a random address instead of some real navigation links it just shows me the header, no content, no redirect. 
  Having <code>ErrorDocument 404 /404.html</code> in .htaccess doesn't help.</p>
  
  <p>Is there a way to solve this?</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [NE,L]
  
    ErrorDocument 404 /404.html
  
  &lt;/IfModule&gt;
  </code></pre>