title: How to get virtual directory in mvc
body: <p>I am working on a .net core application where I need the application path to the virtual directory. I do not want the physical path, I want it in form of url like:</p>
  
  <pre><code>http://www.mywebsite.com/mydirectory
  </code></pre>
  
  <p>I have tried with <code>Request.Host</code> but it only gives me  <code>http://www.mywebsite.com</code> without the virtual directory path.</p>
  
  <p>Any help on this appreciated!</p>