www前缀在NOPCommerce上不起作用



我通过nopcommerce开发了一个网站,一切正常,在测试时我发现当我将www添加到我的域 www.mydomain.com 时它不起作用,但是当我点击 mydomain.com 它工作得很好。

我找到了很多关于同一问题的回复,但似乎都没有解决我的问题,我也在下面尝试过 https://blogs.iis.net/owscott/iis-url-rewrite-rewriting-non-www-to-www

通过使用 URL 重写,它会抛出 500 错误。

请帮忙

使用 MXToolbox 使用 www 查找域后,发现未找到任何记录。因此,建议的解决方法是通过登录域提供商面板为域添加www cname dns记录。

对于那些在使用3.9 之前的版本有困难的人。对我来说,问题是专门设置安全 URL。您必须在商店配置中将其留空(或者没有3w来破解逻辑(,以便nopcommerce自动检测到它。因为在检查 3w 是否存在之前,他使用保存在此字段中的 url,根据 GetStoreHost 方法:

if (useSsl)
{
result = !String.IsNullOrWhiteSpace(currentStore.SecureUrl)
?
// Secure URL is specified. 
// So a store owner doesn't want it to be detected automatically.
// In this case let's use the specified secure URL
currentStore.SecureUrl
:
// Secure URL is not specified.
// So a store owner wants it to be detected automatically.
result.Replace("http:/", "https:/");
}

最新更新