Developer forum

Forum » Development » alternative canonical href for homepage

alternative canonical href for homepage


Reply
We configured our website to use the canonical link in the page heading.
It works fine, but our SEO partner insists that on the homepage the link href needs te be replaced from:

<link rel="canonical" href="/Home.aspx" />

to 
<link rel="canonical" href="http://www.domain.com/" />

Is there a way to alter the canonical href?

Replies

 
Nicolai Høeg Pedersen
Reply
You can either wait untill 7.2 where this issues is fixed, or you can do a Notifications.Standard.Page.PageTitle notification subscriber and say:

If PageView.Current.ID = CType(PageView.Current.Area.Value("AreaFirstPage"), Integer) Then
 Meta.Add("customCan", "<link rel=""canonical"" href=""" & HttpContext.Current.Request.Url.Scheme & "://" & HttpContext.Current.Request.Url.Host & """ />")
End If

And example:
http://devierkoeden.com/Articles/%5BarticleId/15%5D/NotificationSubscribers---Part-1---Introduction.aspx
 

 

You must be logged in to post in the forum