Reputation: 161
I want to do nesting of one site inside SiteCore Site in IIS
I have Created One site ,One Page(/layout/Sites/Neeraj/LHome.aspx) in it and mapped it with Layout(/sitecore/content/Home/Sites/Neeraj/Home) and published the solution in SiteCore Root Site(Name :SiteCore2)
MarkUp of LHome.aspx is following :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>This is Sample Layout</p>
</div>
</form>
</body>
</html>
For mapping of innersite with SiteCore Site In Folder ..I Created Neeraj.config file(path:SiteCore2\App_Config\Include)
Which is as following :
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site
patch:before="site[@name='service']"
inherits="website"
name="Neeraj"
hostName="Neeraj.com"
virtualFolder="/"
rootPath="/sitecore/content/Home/Sites/Neeraj"
startItem="/Home"
database="web"
domain="extranet"
disableClientData="true"
cacheHtml="true"
htmlCacheSize="10MB"
registryCacheSize="0"
viewStateCacheSize="0"
xslCacheSize="5MB" />
</sites>
</sitecore>
</configuration>
In host file I also made entry for the Site as follows :
127.0.0.1 Neeraj.com
But When I tried to Browse inner site (Neeraj.com) ...it doesnot appear on Browser
I view the Preview section of SiteCore ..it also shows Blank
I am not able to find any similar Post regarding it ....
Things I Tried :
I Refer this post : How to nest ASP.NET websites
and convert my virtual directory into application ..still no luck
2. http://sdn.sitecore.net/FAQ/Administration/Project%20in%20Virtual%20Directory.aspx
This post suggest is to remove
remove Sitecore HTTP Modules in the virtual directory’s web.config
But it dont have web config in virtual directory
Nested virtual directory or application within sitecore site, is it possible it also refers to 2nd post
Any suggestion would be helpful
Upvotes: 0
Views: 1070
Reputation: 341
If I'm understanding your correctly, you want to have 2 sites in a single install of Sitecore.
You don't need to nest within a virtual directory. You can do this based on just the content tree. Check out this link on configuration multiple sites.
You content tree might look something like this:
Site1/
Home
Page 1
Page 2
Site2/
Home
Page 1
Page 2
You need to have a site definition (i.e. similar to the site node you already created) for each site.
Site1 Site Definition:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site
patch:before="site[@name='website']"
name="Site1"
hostName="Site1.com"
virtualFolder="/"
rootPath="/sitecore/content/Site1"
startItem="/Home" />
</sites>
</sitecore>
</configuration>
Site2 Site Definition:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site
patch:before="site[@name='website']"
name="Site2"
hostName="Site2.com"
virtualFolder="/"
rootPath="/sitecore/content/Site2"
startItem="/Home" />
</sites>
</sitecore>
</configuration>
Lastly, if you want Site2 to be a virtual directory of Site1 (i.e. Site1.com/Site2) then you can use the virtualFolder attribute. see info on the virtualFolder attribute here and physicalFolder here.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site
patch:after="site[@name='Site1']"
name="Site2"
virtualFolder="/Site2"
rootPath="/sitecore/content/Site2"
startItem="/Home" />
</sites>
</sitecore>
</configuration>
Upvotes: 0