title: htaccess 404 redirect does not working
body: <p>I have a <strong>.htaccess</strong> file to manage <strong>rewrite_rules</strong> on my website. I also set a <strong>404 redirect</strong> command to navigate visitors to a specefied page if they enter a wrong URL. But this redirect does not working and I get <strong>500 Internal Server Error</strong> if visitor request an invalid URL. Below is some part of my codes:  </p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^/]+)/([^/]+)/([0-9]+)/([^/]+)/?$ index.php?lang=$1&amp;page=$2&amp;id=$3&amp;des=$4 [NC,QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^/]+)/([^/]+)/(p[0-9]+)/?$ index.php?lang=$1&amp;page=$2&amp;pn=$3 [NC,QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^/]+)/([^/]+)/?$ index.php?lang=$1&amp;page=$2 [NC,QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^/]+)/?$ index.php?lang=$1&amp;page=home [NC,QSA,L]
  
  ErrorDocument 404 http://www.mywebsite.com/404/
  </code></pre>
  
  <p>What is missing in my code that causes this problem?</p>