customizing url mapping of multiple sites in sitec

2019-08-10 01:17发布

So, I want to customize my mappings of urls to home pages inside Sitecore

my sites home pages are nodes like this (below /sitecore/content):

/FOO/us
/FOO/ca
/FOO/..other countries
/BAR

i Want to reach them by the following urls:

mysite.com/us -> /FOO/us
mysite.com/ca -> /FOO/ca
mysite.com/bar -> /BAR

my sites declarations are like this

<site name="FOO-US" virtualFolder="/us" physicalFolder="/us" rootPath="/sitecore/content" startItem="/FOO/us" 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="FOO-CA" virtualFolder="/ca" physicalFolder="/ca" rootPath="/sitecore/content" startItem="/FOO/ca" 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="BAR" virtualFolder="/bar" physicalFolder="/bar" rootPath="/sitecore/content" startItem="/bar" 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" />

However, i never get the expected url resolution, mostly i get 404 or get to the default Home node.

i'm testing this multi-site configuration in sitecore (6.5) in my local IIS (both 6.0 and 7.0 versions with no luck). Is that possible?

2条回答
祖国的老花朵
2楼-- · 2019-08-10 01:27

You can't get this to work out of the box because they're all on the same hostname (mysite.com). You can get it to work if you set the startItem to FOO and put bar underneath it. Then all three separate "sites" would be immediate children of the root (FOO). E.g.

/Foo/us
/Foo/ca
/Foo/bar
查看更多
何必那么认真
3楼-- · 2019-08-10 01:38

Did you remove the default 'website' definition? (you probably should). You may be able to do this by juggling the root and startItem paths, perhaps :

rootPath="/sitecore/content/FOO" startItem="/us"
rootPath="/sitecore/content/FOO" startItem="/ca"
rootPath="/sitecore/content" startItem="/bar"

or maybe (untested) :

rootPath="/sitecore/content/FOO/us" startItem=""
rootPath="/sitecore/content/FOO/ca" startItem=""
rootPath="/sitecore/content" startItem="/bar"

If these are just vanity urls rather than seperate sites, then leave the config as one site and use redirects (use one of the redirect modules) instead.

查看更多
登录 后发表回答