title: How to prevent AEM/Sling from adding trailing slash to the extensionless URLs?
body: <p>All extensionless URLs on the site, which resolve to the actual nodes, are being redirected (with 301 code) to their versions with added trailing slash. It doubles amount of requests to the frontend web server so we would like to fix this.</p>
  
  <p>We do use Apache mod_rewrite to rewrite all incoming URLs (with or without slash) to their .html equivalents in order to make dispatcher caching consistent, but the actual processing is a bit weird.</p>
  
  <p>In general, we have three cases:</p>
  
  <ol>
  <li>URL has an extension ( i.e. /content/xxx/yyy.html ) - it's being processed right away, <strong>no redirects</strong></li>
  <li>URL has trailing slash ( /content/xxx/yyy/ ) - it is processed by mod_rewrite and rewritten to /content/xxx/yyy.html successfully. <strong>no redirects</strong></li>
  <li>Extensionless URL ( /content/xxx/yyy ) - processed by mod_rewrite, rewritten to /content/xxx/yyy.html and immediately <strong>redirected</strong> to /content/xxx/yyy/ which is subsequently goes through the routine from the point 2 above.</li>
  </ol>
  
  <p>To exclude Apache originated redirects we disabled almost all modules, such as mod_dir, mod_negotiation, mod_autoindex, etc to avoid redirects due to the content negotiation or directory indexing but requests are still being redirected.</p>
  
  <p>Our app doesn't contain any redirects based on the URL so I'm wondering if there is any OSGI service or hidden configuration setting which triggers such redirects?</p>
  
  <p>We also have a set of shortcuts on the site, Apache rewrites them to actual URLs and they are <strong>NOT</strong> being redirected. 
  For example, if requesting URL is /aboutus it's being successfully mapped to the /content/xxx/yyy/operations/aboutus.html and processed in one loop without any additional redirects. The problem described above is valid only there is an actual corresponding  node in JCR and request is extensionless.</p>