title: Authorize & Authenticate access to static content (pdf)
body: <p>I have an <strong>asp.net web app</strong> and accessible with form authentication. Inside the folder structure looks like this:-</p>
  
  <pre><code>\myapp
  \document\pdf\hello1.pdf
  \document\pdf\hello2.pdf
  \document\pdf\hello3.pdf
  \document\pdf\hello4.pdf
  </code></pre>
  
  <p><a href="http://localhost/myapp/document/pdf/hello1.pdf" rel="nofollow">http://localhost/myapp/document/pdf/hello1.pdf</a></p>
  
  <p>Now these pdf files are used in the anchor links within the app. Now i want to enforce the authentication &amp; authorization to restrict the direct access to these static resources. If there is access from outside the app, it should go to the login page.</p>
  
  <p>I cannot change the path of the files in the anchor tags because i used it at many places across the app.</p>
  
  <p>Is there a way to do with web.config ?</p>
  
  <p>Pls suggest some solutions.</p>
  
  <p>Thanks. </p>