If you're using off box SSL Termination with SharePoint how do you determine the Public URL of the current page the url the user has in the browser) e.g.

  1. Browser : httpS://sharepoint/somesite
  2. SSL Termination server converts to : http://sharepoint/somesite
  3. IIS/SharePoint Receives : http://sharepoint/somesite
  4. SharePoint returns page to browser with urls starting : httpS://sharepoint/somesite

At 3. if you use Context.Request.Url, Page.Request.Url or Page.Request.RawUrl it will return a http url not httpS

How do get the public httpS URL of the current page in this case?


This is what Alternate Access Mappings are for for but it should not matter depending on what other features the SSL offload device has.

Your SSL offload device / server should be able to do protocol translation or URL rewriting as well so if it receives a HTTP request it should convert them automatically to HTTPS. Therefore http://sharepoint/somesite --> httpS://sharepoint/somesite.

So even if SharePoint is rendering HTTP URLs, when the user clicks on them, your SSL offload device would convert them to HTTPS when is receives that traffic.

So this way your URLs work even if you don't define special Alternate Access Mappings to handle HTTP scenarios.

Hope this helps. If not it would help to know more about the stack you are running SharePoint through.


  • Its actually HNSC in 2013 so can't use AAM. Problem comes when using things like SPWeb.GetViewFromUrl as the url I pass is http but SharePoint throws not found exception because all its HNSC are httpS. – Ryan Apr 2 '14 at 17:15
  • You can use AAM and HNSC together just fine. Use the Set-SPSiteUrl cmdlet to add additional URL's for all of the zones in AAM. That also allows you to link a http and https URL to a single site collection. – Jasper Jul 17 '14 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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