title: File name too long: Cannot map GET, ignores .htaccess ErrorDocument 403
body: <p>I am using an Apache 2.2 server, and have a <code>.htaccess</code> file in my document root with the following content:</p>
  
  <pre><code>ErrorDocument 403 /index.php
  </code></pre>
  
  <p>Though when I access the server with a long GET URL (e.g. request <code>http://example.com/long/long/long/long/.../url</code>), a <code>403</code> forbidden response is returned. Therefore, my <code>.htaccess</code> <code>ErrorDocument</code> is ignored.</p>
  
  <p>The apache_error.log contains:</p>
  
  <pre><code>[Mon May 09 08:14:16 2016] [error] [client ::1] (63)File name too long: Cannot map GET /long/long/long/long/long/long/long/longlong/long/long/longlong/long/long/longlong/long/long/longlong/long/long/longlong/long/long/longlong/long/long/long/.../url HTTP/1.1 to file
  </code></pre>
  
  <p>As I understood, the server ignores the <code>.htaccess</code> file when it receives a too long GET URL and therefore per-directory <code>ErrorDocument 403 /index.php</code> is ignored.
  If I put the <code>ErrorDocument</code> directive inside of my local server's main config (httpd.conf, I tested it locally), everything works and <code>/index.php</code> is executed for this type of requests, so I can send a custom page.</p>
  
  <p>However, I would like to handle that type of request with a custom page using an .htaccess as I don't have access to the remote server's main config file.</p>
  
  <p>Can I do it somehow?</p>