Load balanced site with multiple domains and cultures sets wrong domain for canonical url
I'm running into a strange issue where the wrong domain is sometimes set in the rel canonical tag. I'm pretty sure the problem is that Document.ContextInfo.Host is not returning the expected domain for some reason. When I call Model.Url(Culture, UrlMode.Absolute), the correct url is returned, so this appears to be an seo checker issue.
Fortunately, it's not difficult to work around with a find and replace, but ideally I wouldn't have to take that step. I also updated the package to 2.11.5, but I'm not sure that will help as the changes in it aren't mentioned on the release notes page.
For anyone else's reference, I'm doing the following
var metaData = Model.Value<SEOChecker.MVC.MetaData>("seoChecker")
var tags = metaData.AllTags.ToString();
//hack to fix rel canonical tag
var canonicalCheck = new Regex("<link rel=\\\"canonical\" href=\"([^\"]+)\"");
var canonicalMatch = canonicalCheck.Match(tags);
if (canonicalMatch != null) {
var url = canonicalMatch.Groups[1].Value;
tags.Replace(url, Model.Url(Culture, UrlMode.Absolute));
}
@Html.Raw(tags)
I believe I am seeing a similar problem on SEO Checker version 12.0.1 on Umbraco 12.3.7.
I will get the right URL from Umbraco when I call the URL() method. But the canonical from SEO Checker will just be the base address. But only on some pages.
Load balanced site with multiple domains and cultures sets wrong domain for canonical url
I'm running into a strange issue where the wrong domain is sometimes set in the rel canonical tag. I'm pretty sure the problem is that Document.ContextInfo.Host is not returning the expected domain for some reason. When I call Model.Url(Culture, UrlMode.Absolute), the correct url is returned, so this appears to be an seo checker issue.
Fortunately, it's not difficult to work around with a find and replace, but ideally I wouldn't have to take that step. I also updated the package to 2.11.5, but I'm not sure that will help as the changes in it aren't mentioned on the release notes page.
For anyone else's reference, I'm doing the following
SEO Checker: 2.11.4
Umbraco: 8.18.9
I believe I am seeing a similar problem on SEO Checker version 12.0.1 on Umbraco 12.3.7.
I will get the right URL from Umbraco when I call the URL() method. But the canonical from SEO Checker will just be the base address. But only on some pages.
is working on a reply...