title: htaccess redirect for folder-only URL
body: <p>I would like to know how a full pathname call for a pdf can be served showing only the enclosing folder URL. This is for keeping the URLs minimal while doing some logging.</p>
  
  <p>The file structure for each in a series of documents is (example):</p>
  
  <pre><code>/mysite.com/docs/doc-4-5/
      index.php
      document-4-5.pdf
  </code></pre>
  
  <p>The index does some logging, then redirects:</p>
  
  <pre><code>doLogging(); 
  header('Location:document-4-5.pdf');
  </code></pre>
  
  <p>This works. A call to the folder returns the pdf. But the return URL includes the pdf's full pathname, and I would like it to show only the enclosing folder name, so when you get the pdf, the URL you see is (example):</p>
  
  <pre><code>/mysite.com/docs/doc-4-5/
  </code></pre>
  
  <p>Thus, refresh calls for the pdf, or any full pathname call to it, will always go through the index.</p>
  
  <p>It seems this can be done with redirect, but I have not been able to do it, and will appreciate guidance. </p>
  
  <p>Thank you. </p>