title: How can I get the baseurl of my site in ASP.NET Core?
body: <p>Say my website is hosted in the <strong>mywebsite</strong> folder of <strong>www.example.com</strong> and I visit <a href="https://www.example.com/mywebsite/home/about" rel="noreferrer">https://www.example.com/mywebsite/home/about</a>.</p>
  
  <p>How do I get the base url part in an MVC controller? The part that I am looking for is <strong><a href="https://www.example.com/mywebsite" rel="noreferrer">https://www.example.com/mywebsite</a></strong></p>
  
  <p>The example listed <a href="https://stackoverflow.com/questions/1288046/how-can-i-get-my-webapps-base-url-in-asp-net-mvc">here</a> doesn't work as we don't have access to Request.Url in ASP.NET Core</p>