title: In C# MVC4 how to get the server path?
body: <p>In c# MVC4 how to I get the server path. for example: <code>http://192.169.1.120:60632</code></p>
  
  <p>Is there a helper function that I can convert something like <code>~/aFolder/file.htm</code> into an absolute path? Ideally I would like a way of taking any given url and convert into a full absolute url. E.g. can cope with..</p>
  
  <ul>
  <li>/aFolder/file.html         -> <code>http://192.169.1.120:60632/aFolder/file.html</code></li>
  <li><a href="http://website.com/file.html" rel="nofollow">http://website.com/file.html</a>     -> <code>http://website.com/file.html</code></li>
  </ul>
  
  <p>And will work anywhere within the c# code - i.e. in a action controller, signalR hub, model etc.</p>
  
  <p>And it will still work when I deploy to a remote server.</p>