November Happy Hour will be moved to Thursday December 5th.

LinkItem and GetMappedHref

Vote:
 

Hi,

I'm using LinkItems to display links to documents in a page panel and building the anchor dynamically using an asp HTMLAnchor control. To set the HRef attribute of the anchor I am using the GetMappedUrl() method as this provides the correct link.

This also appends a language parameter to the end of the link eg ?epslanguage=en-gb. While this works and links correctly this is causing issues with some search software which is indexing the site. The indexer seems to be indexing the same link twice, once with the language parameter and once without (in some cases it only indexes one link, the one with the parameter).

Note that this is a single language site set to en-gb and all other languages are turned off. Does anyone know of a way to prevent the language parameter being added? Can anyone provide any other advice?

Thanks in advance,

Mark

#47460
Jan 28, 2011 16:45
Vote:
 

The easy way to turn it of is to make your own friendly url rewriter

 protected override bool ConvertToInternalInternal(UrlBuilder url, ref object internalObject)
 {
bool ok=base.ConvertToInternalInternal(url,ref internalObject);
url.QueryCollection.Remove("epslanguage")
return ok;
}

#47466
Jan 28, 2011 18:55
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.