SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a web application on my sharepoint farm: sharepoint.local Name: https://app.sharepoint.local

Outside of my farm the site is available through an UAG server on:

(UAG/AAM pointing to the internal url)

In my code behind I use the current url to specify my web app url and execute some code. I was wondring how I could dynamically retrieve my web app url if users are using the public url:

Are there out of the box functions for this?

share|improve this question

You can use this.Page.Request.Url, unless I'm missing something.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.