Reputation:
I'm currently using 7.1 update 2 running multiple sites using web forms. I'm starting a new site and want to use MVC but can't get it to work; however, I can get the default "website" to use MVC but not a custom site.
For example, let's say I have two sites, site1 and site2, site1 is web forms and works fine, how do I define "site2" which is MVC? Not sure what the value should be in the "physicalFolder" property. Or the site should be defined somewhere else.
Thanks
<site name="site1"
targetHostName="site1.com"
hostName="site1.com"
virtualFolder="/"
physicalFolder="/site1"
rootPath="/sitecore/content/site1"
startItem="/Home"
language="en"
database="master"
domain="extranet"
allowDebug="true"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
enableWorkflow="true"
patch:before="site[@name='website']" />
Upvotes: 0
Views: 275
Reputation: 867
The physicalFolder parameter will allow you to specify the physical path that Sitecore will look for any physical files it needs for the specified site. It is one of the options that can be used to organize the physical files for multisite instances.
You will see the following definition in the web.config comments:
physicalFolder: The physical location of files for the site.
If the site is based on physical files, this is the path to the folder holding the files.
For non-physical sites, this is the place where Sitecore looks for a default.aspx file (to start the pipelines).
You can find more information about the physicalFolder parameter here -> http://sdn.sitecore.net/Articles/Administration/Configuring%20Multiple%20Sites/Adding%20New%20Site/site%20Attribute%20Properties/physicalFolder.aspx
As for configuring your MVC site, there really isn't anything special you need to do in terms of your Site definition. You should just be able to replicate your Site1 definition and make the appropriate updates. Sitecore will utilize the correct rendering method based on the Layout and Sublayouts defined on your Pages.
<site name="site2"
targetHostName="site2.com"
hostName="site2.com"
virtualFolder="/"
physicalFolder="/site2"
rootPath="/sitecore/content/site2"
startItem="/Home"
language="en"
database="master"
domain="extranet"
allowDebug="true"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
enableWorkflow="true"
patch:before="site[@name='website']" />
Upvotes: 1