title: 500 Internal Server Error when trying to use ErrorDocument to handle request
body: <p>I have this .htaccess file:</p>
  
  <pre><code>Options -Indexes
  RewriteEngine on
  
  ErrorDocument 404 /404.php
  
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule ^([^/]*)/?(.*)$ ./$1.php
  
  RewriteCond %{THE_REQUEST} \.php
  RewriteRule ^(.*)$ - [L,R=404]
  </code></pre>
  
  <p>However, when I go to <code>localhost/example.php</code>, it returns a 500 Internal Server Error.</p>
  
  <p>Any help please? Thanks.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The full error message that comes up is:</p>
  
  <pre><code>Not Found
  
  The requested URL /example.php was not found on this server.
  
  Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  </code></pre>