1
votes

I have 2 Sitecore sites with the same site tree (we'll call them SiteABC and SiteXYZ). Sometimes, in the Rich Text Editor for a page, there needs to be a link from one site's subpage to a subpage on the other. The problem I'm facing is that the Internal Links are not returning the correct host names.

UPDATE: I have fixed the internal link issue regarding linking a page on SiteXYZ to a page on SiteABC. See the updated Web.config code below.

<site name="siteabc" hostName="siteabc.local.com" targetHostName="siteabc.local.com:8080" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/siteabc" database="web" domain="extranet" allowDebug="true" cacheHtml="false" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0"
    xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" />
<site name="wwwsiteabc" hostName="www.siteabc.local.com" targetHostName="siteabc.local.com:8080" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/siteabc" database="web" domain="extranet" allowDebug="true" cacheHtml="false" htmlCacheSize="10MB" registryCacheSize="0"
    viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" />
<site name="wwwsitexyz" hostName="www.sitexyz.local.org" targetHostName="sitexyz.local.org" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/sitexyz" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0"
    viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" />
<site name="sitexyz" hostName="sitexyz.local.org" targetHostName="sitexyz.local.org" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/sitexyz" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0"
    xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" />

I am still having trouble with internal links to SiteXYZ from SiteABC. Even though I have set the targetHostName for SiteXYX to be sitexyz.local.org, there is still a problem with the url--8080 keeps being appended:

sitexyz.local.org:8080/parentPage/childPage.aspx

This is incorrect as it should be sitexyz.local.org--no 8080 attached.

Is there any way I can fix this by adjusting a setting in the Web.config file? I don't want to have to create some custom class to override anything -- I'm still learning Sitecore and have no idea how I would go about doing something like that :\ I'm assuming there is something in the Web.config I can change, though, just not sure what as I haven't dealt with this sort of issue before in Sitecore.

1
Have you tried set targetHostName to the site definition? See sdn.sitecore.net/Articles/Administration/…Marek Musielak
Setting the targetHostName for SiteABC worked, but it does not work for SiteXYZ. See my updated post for the details.Dejsa Cocan
Try adding port="80" to the SiteXYZ definition.Marek Musielak

1 Answers

1
votes

For multisite environments, if you want to cross-link between the sites, always use targetHostName for every site definition. That tells Sitecore what should be the hostname of the generated urls, if the item belongs to given site.

And for the port problem, if port is not specified for the target site, Sitecore uses port number from your current site. That's why Sitecore adds :8080 to your links. Just add port="80" to your SiteXYZ definition and the problem should be gone.

More documentation can be found in site Attribute Properties article. For some reason it does not contain port information, but it's there in the SiteInfo class.