自定义域名设置godaddy和azure

问题描述:

我有Godaddy的域名和托管是从Azure。自定义域名设置godaddy和azure

我要为我已阅读link

我的网站正在使用打开自定义域设置都www.domainname.com和domainname.com 但社交媒体不工作。

所以我的问题是在天蓝色我添加了www.domainname.com或两者?

,如果我只添加domainname.com然后纳克域会给404错误

请帮我的。 enter image description here enter image description here

所以我的问题是蔚蓝我已经添加www.domainname.com或两者兼而有之?

是的,您应该在Azure门户上添加这两个域。 Azure Web应用程序将检查主机名并将其与Azure门户上设置的主机名进行比较。

此外,www CNAME记录应绑定到您的Web应用程序的默认域。例如,agentsdeal.azurewebsites.net

但我使用ASPNET身份,现在的问题是,如果我登录使用agentsdeal.com无法登录在www.agentsdeal.com我的事情Azure是为每个域使不同时刻

您需要设置在Startup.Auth.cs文件中写入的app.UseCookieAuthentication中的CookieDomain。以下代码供您参考。

app.UseCookieAuthentication(new CookieAuthenticationOptions 
{ 
    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 
    LoginPath = new PathString("/Account/Login"), 
    CookieDomain = ".agentsdeal.com" 
}); 
+0

感谢名单重播 它为我工作,但我使用ASPNET身份 现在的问题是,如果我登录使用agentsdeal.com无法登录在www.agentsdeal.com 我的事情Azure是使每个不同时刻域 –

+0

您可以通过在Startup.Auth.cs文件中设置CookieDomain来解决此问题。请参阅我的回复更新中的示例代码。 – Amor