Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 使用虚拟文件夹访问sitecore内容 问题_Url_Content Management System_Sitecore_Sitecore6 - Fatal编程技术网

Url 使用虚拟文件夹访问sitecore内容 问题

Url 使用虚拟文件夹访问sitecore内容 问题,url,content-management-system,sitecore,sitecore6,Url,Content Management System,Sitecore,Sitecore6,我们有两个站点,一个域,我们想在该域上设置一个虚拟目录,该目录可以访问第二个站点 IIS虚拟目录似乎没有做到这一点,sitecore似乎没有很好地发挥作用 使用sitecore是否有潜在的解决方案 环境 我们有两个网站的文件夹结构如下: C:\Sitecore\Site1 C:\Sitecore\Site2 站点1和站点2都连接到相同的web、核心和主数据库 要在浏览器中访问两个站点的cms,我们需要: www.mysite1.com/sitecore 从站点1的cms中,我们为站点1和

我们有两个站点,一个域,我们想在该域上设置一个虚拟目录,该目录可以访问第二个站点

IIS虚拟目录似乎没有做到这一点,sitecore似乎没有很好地发挥作用

使用sitecore是否有潜在的解决方案

环境 我们有两个网站的文件夹结构如下:

  • C:\Sitecore\Site1

  • C:\Sitecore\Site2

站点1和站点2都连接到相同的web、核心和主数据库

要在浏览器中访问两个站点的cms,我们需要:

  • www.mysite1.com/sitecore
从站点1的cms中,我们为站点1和站点2创建内容、布局和模板

解决方案 我们所做的是在第一个sites web.config中将站点定义为正常:

<site name="site1" hostName="mysite1.com" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/MyItem1/" 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" />

在第二个sites web.config中,我们对站点的定义略有不同:

<site name="site2" hostName="mysite1.com" virtualFolder="/Site2" physicalFolder="/" rootPath="/sitecore/content" startItem="/MyItem2/" 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" />    

我们定义的第二个站点是一个虚拟文件夹,您可以在上面注意到这是唯一的区别以及明显的开始项区别

站点1将像正常一样响应。您可以访问mysite1.com,它将加载与网站1相关的开始项

当您访问mysite1.com/Site2/时,它将加载在第二个站点中定义的虚拟文件夹并加载其相关的开始项

这差不多就是它的魅力所在

最后,@Mark Ursino感谢你的帮助

注意
您需要启用sitecore可伸缩性配置,以使上述任何一项正常工作

据我所知,我认为您需要在配置中进行一些更改,以将“子文件夹站点”设置为虚拟文件夹:

<site virtualFolder="/subsite" physicalFolder="/subsite" rootPath="/sitecore/content" startItem="/MyItem/" 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" />

请注意,
virtualFolder=“/subsite”
physicalFolder=“/subsite”
指向子文件夹,但我认为您实际上不需要该物理文件夹


.

也许这篇文章会很有用

请从您的
网站提供
配置。config添加了配置,以便您可以看到我基本上要做的事情。明白了。嗯,我对
myitem
/Partners/UK/
/Partners/NZ/
的关系有点困惑。。。是不是
myitem
就是其中之一?是的,很抱歉,只有一个站点,上面的起始项是:/myitem/ammend。那么当您访问
www.example.com/myitem-no2/
时,它会呈现该项目吗?但是当您调用LinkManager.GetItemUrl(…)时,它呈现为
www.example.com/sitecore/content/myitem/myitem-no2/
?我还不确定到底是什么问题。我想这行得通吧?我对自己的知识更感好奇,因为我从来没有做过这样的事情,所以不得不去查阅。我已经重写了整个问题,以便你能得到更好的想法@Mark UrsinoClose,但不完全符合具体问题的要求。我喜欢Alex Shyba在他的文章中链接到我的博客-D