views:

39

answers:

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.

+2  A: 

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