title: web.config rewrite from one directory to another
body: <p>I'm struggling to transform an Apache .htaccess rewrite to an IIS rewrite. I would like to rewrite from one directory to another.</p>
  
  <p>Example: If someone accesses the URI: <code>/booklets/MyPDF.pdf</code> then the rewrite would access the file using <code>/res/pdf/MyPDF.pdf</code></p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;rewrite&gt;
        &lt;rules&gt;
          &lt;rule name="Rewrite for booklets location" enabled="true"&gt;
              &lt;match url="^booklets/(.*).pdf" /&gt;
              &lt;action type="Rewrite" url="res/pdf/{R:1}.pdf" /&gt;
          &lt;/rule&gt;
  
        &lt;/rules&gt;
      &lt;/rewrite&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>