SPWeb.Url 返回错误的 URL
我在 SharePoint 中有一个 Web 应用程序,该应用程序已扩展到另一个区域(外联网)。默认域的访问地址为http://server1,外网域的访问地址为https://www.server1.com。
现在,当我通过 Extranet 区域访问该站点时,我发现 SPContext.Current.Web.Url 返回 http://server1。我本来期望 https://www.server1.com,因为这就是我访问该网站的方式。我做错了什么?
I have a web application in SharePoint that has been extended to another zone (Extranet). The access URL for the default zone is http ://server1, and the URL for the extranet zone is https: //www.server1.com.
Now, when I access the site via the extranet zone, I find that SPContext.Current.Web.Url returns http ://server1. I would have expected https ://www.server1.com, since that's how I'm accessing the site. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用:
这应该考虑到您的访问映射。
Try using:
That should take into account your access mappings.
奇怪...
作为替代方案,您是否尝试过使用 HttpContext.Current.Request.Url ?
Odd...
As an alternative, have you tried using HttpContext.Current.Request.Url ?