title: Redirect (rewrite?) all .PDF requests on Apache server to .php file
body: <p>So I am building an application that necessitates redirecting (or is it rewriting? I need to do the one where the URL remains the same on the client side) to a .php file for all requests that occur for .pdf files in a given directory on my web server (Apache). However, I only want this request to be rewritten if the user is trying to display the PDF in a browser (not download it). I have a feeling this second part is not possible.</p>
  
  <p>Does anyone have some good resources to look into that not only depict the syntax that I will need to use but also what is going on behind the scenes with the Apache server?</p>
  
  <p>Also, does anyone have an idea as to how I can determine if the file is being directly downloaded or requested via web-browser? I have a feeling that, since when you access a PDF file via a browser, it seems to download it and display it using the Adobe Reader plugin, that there is no distinction that can be made between the two.</p>
  
  <p>Best regards,</p>