1

I have a Sitecore 6.2 installation with 2 sites, configured like so:

<site name="eu-website" hostName="dev.mysite.eu" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/Europe" startItem="/Home" 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="us-website" hostName="dev.mysite.us" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/USA" startItem="/Home" 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" />

The sites are responding to the URLs as expected, i.e:

http://dev.mysite.eu/About -> Resolves to: /sitecore/content/Europe/About

However, I'm having trouble with the LinkManager. It's generating incorrect URLs, such as:

http://dev.mysite.eu/Europe/About

As you can see, it's including the name of the site, which is incorrect and causes a 404.

I'm using LinkManager like so:

var urlOptions = new UrlOptions();
urlOptions.SiteResolving = true;

string url = LinkManager.GetItemUrl(item, urlOptions);

Anyone know where I'm going wrong?

Thanks.

Bartłomiej Mucha
  • 2,762
  • 1
  • 30
  • 36
Andy Holt
  • 572
  • 2
  • 9
  • Please paste the whole section in (because the order of sites matters) and also the LinkProvider definition from web.config. – Alex Shyba Oct 17 '10 at 22:29

1 Answers1

3

This might not fix it but try to pull out the node that holds the site into the startItem:

Change:

rootPath="/sitecore/content/Europe" startItem="/Home"

To:

rootPath="/sitecore/content" startItem="/Home/Europe"
Mark Ursino
  • 31,209
  • 11
  • 51
  • 83