Developer forum

Forum » Swift » og:url with ensure unique paths for each area

og:url with ensure unique paths for each area

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi,

We are running into an issue where metatag og:url is getting the scheme and host duplicate in output. We solution has multiple websites with primary domains set. With this setup, the Pageview.SearchFriendlyUrl returns the full url including http or https. 

Swift code does not perform any validation resulting in:
<meta property="og:url" content="https://www.mysite.comhttps://www.mysite.com/home">

Pageview.Meta.AddTag($"<meta property=\"og:url\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{Pageview.SearchFriendlyUrl}\">");

BR Mario


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

How is your website settings - what do you have in your domain settings, and what do you have on the "Home" page in URL settings?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I can see the issue now.

 

You must be logged in to post in the forum