title: Get virtual path for a full path in asp classic
body: <p>How can I get the virtual path for a full path in ASP classic.  Note that the full path may be under a virtual directory and therefore the simplistic </p>
  
  <pre><code>virtPath = Replace(fullPath, Server.MapPath("/"), "") 
  </code></pre>
  
  <p>method will not work.</p>
  
  <p>Edit: To clarify, an example follows</p>
  
  <ul>
  <li>Full Windows File Path (known):
  <strong>\\MyServer\MyShare\Web\Site\Logs\Test.txt</strong></li>
  <li>My Website has a Virtual directory
  called <strong>Logs</strong> that Points to <strong>\\MyServer\MyShare\Web\Site\Logs\</strong>.</li>
  <li>Virtual Path (unknown): <strong>/Logs/Text.txt</strong></li>
  <li>Http path (unknown, needed):
  <strong><a href="http://Site/Logs/Test.txt" rel="noreferrer">http://Site/Logs/Test.txt</a></strong></li>
  <li>The code is in a asp page in the main app, not under any virtual directories.  It is located on a separate server from the file in question.</li>
  <li><p>IIS 6.0</p>
  
  <p>How do I find the virtual path from the full file path?</p></li>
  </ul>