2

I'm using a Sitecore install with multiple sites. When linking from example1.com (/sitecore/content/example1) to an item under example2.com (/sitecore/content/example2/about)

Sitecore is not generating the link correctly for any cross-domain links. It is generating: http://www.example1.com/example2/about.aspx This is what is expected: http://www.example2.com/about.aspx

The same thing happens from example2.com when linking to example1.com or any item under that site.

  • Both sites are defined in the web.config.

  • The rootNodes are both "/sitecore/content"

  • The start items are "/example1" and "/example2" respectively.

  • Rendering.SiteResolving is set to true

  • Rendering.SiteResolvingMatchCurrentSite is set to false

  • I'm using sc:link to generate the links.

  • Sitecore.Links.LinkProvider's alwaysIncludeServerUrl is set to true

4

2 回答 2

4

如果您使用带有通配符的主机名(例如“www.example1.com|example1.com”),则需要在您的条目上设置 targetHostName="www.example1.com"。

即使您只有一个域,也要设置 targetHostName,因为有一个东西/功能只查看 targetHostName。例如。在没有 targetHostName 和 6.5.0 版本的情况下,GetItemUrl() 无法按计划工作。120706 它不考虑 web.config 中设置的内容。这是一个错误,他们希望在未来的版本中修复。如果您遇到问题,请在此处寻找解决方案: http ://sitecorepm.wordpress.com/2010/08/04/using-cross-site-links-dynamic-links/

于 2013-02-06T10:29:03.593 回答
2

您是否在 web.config 中设置了 <site> 条目的主机名值?

<site name="example1" hostName="www.example1.com" ... />
<site name="example2" hostName="www.example2.com" ... />

这里有一篇非常好的博客文章:http: //blog.paulgeorge.co.uk/2011/05/01/sitecore-linkmanager-inside-out-muti-site-and-sub-site-setups/ 它看起来就像您已经涵盖了完成这项工作所需的所有其他内容。

于 2013-02-05T18:41:01.217 回答