1
votes

I have a Sitecore solution with multiple sites. All sites are setup in SiteDefinition.Config, and i can enter all the sites correctly.

My problem is that the internal links on the sites (navigations etc.) prefixes 'sitecore/content/sitename/' to all my links.

i have tried almost all the fixes/solutions i could think off - but no luck.

Any ideas?

4
What version of Sitecore are you running? Are you seeing this with all Link fields as well as Rich Text fields? - Sean Kearney
It is a Sitecore 6.2. And yes, it does the same for both my navigation (using xslt and sc:path) and links inserted in the Rich Text Editor - all with the same prefix. - kastru
It would be easier to help if you could provide the code from SiteDefinition.Config. - Zooking
It's possible your config requires this... otherwise the links could be ambiguous. Are you linking to items across sites? - Bryan

4 Answers

0
votes

I ran into a similar problem however mine only occurred when the links were between internal sites. I wrote 2 blog posts (post #1, post #2) that detail the solution i used. In short, it involves extending Sitecore's LinkProvider...

0
votes

Are your site definitions setup to use different values for the rootPath attribute?

<site name="mysite1" rootPath="/sitecore/content/mysite1" startItem="/home" hostName="mysite1.com" ... />
<site name="mysite2" rootPath="/sitecore/content/mysite2" startItem="/home" hostName="mysite2.com" ... />
0
votes

Is your

<setting name="Rendering.SiteResolving" value="true" />

set?

-1
votes

if you want to create links the way you want you have to use a LinkManager Config and then get url using the GetDynamicUrl method.

Sitecore.Links.LinkUrlOptions options = new LinkUrlOptions();
options.Site = "Site1";
string portalUrl = LinkManager.GetItemUrl(Item, options);

Hope it helps.