views:

183

answers:

1

Hi,

I have deployed my web part to a SharePoint environment having alternate accessing mapping configured. The public Url is https://sharepoint.com and the internal url for the same is http://internal-sharepoint.com

On one button click, i need to redirect the url to the same page with some additional parameter in query string.

I tried with both SPcontext.Current.Web.Url and Page.Request.Url.ToString() and both of them seem to give me the internal Url rather than the mapped url.

So the sequence is User types in https://sharepoint.com, clicks on the button and gets redirected to http://internal-sharepoint.com?myparam=somthing. Rather i would expect it be https://sharepoint.com?myparam=somthing

Please let me know your thoughts.

Thanks

A: 

Did you add both urls as public URLs in Alternate Access mapping?

Regardless, Page.Request.Url should always return the exact url you're seeing in the browser..

ArjanP
Yes. Both urls are added as public urls in aam. I too expected that Page.Request.Url should have returned the exact url but does not seem to be the case.They seem to be using reverse proxy as well . Should that make any difference?Thanks
Faiz
ah there is a reverse proxy? so the sharepoint site doesn't 'see' the external url. This would explain the page.request.url anomaly. You should not be using the reverse proxy to get this to work. If someone uses the external url, SharePoint should 'see' them as using that same url.
ArjanP