<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fconcepts%2FVirtual_Roots</id>
	<title>Cchost/concepts/Virtual Roots - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fconcepts%2FVirtual_Roots"/>
	<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/concepts/Virtual_Roots&amp;action=history"/>
	<updated>2026-10-06T23:24:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki-dev.creativecommons.org/index.php?title=Cchost/concepts/Virtual_Roots&amp;diff=19723&amp;oldid=prev</id>
		<title>Fourstones: New page: Category:ccHost Category:ccMixter Category:Developer Category:Software Category:Technology {{cchost_head}} {{lowercase}}  Your ccHost site can be configured to look lik...</title>
		<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/concepts/Virtual_Roots&amp;diff=19723&amp;oldid=prev"/>
		<updated>2008-11-12T10:39:16Z</updated>

		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/wiki/Category:CcHost&quot; title=&quot;Category:CcHost&quot;&gt;Category:ccHost&lt;/a&gt; &lt;a href=&quot;/wiki/Category:CcMixter&quot; title=&quot;Category:CcMixter&quot;&gt;Category:ccMixter&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Developer&quot; title=&quot;Category:Developer&quot;&gt;Category:Developer&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Software&quot; title=&quot;Category:Software&quot;&gt;Category:Software&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Technology&quot; title=&quot;Category:Technology&quot;&gt;Category:Technology&lt;/a&gt; {{cchost_head}} {{lowercase}}  Your ccHost site can be configured to look lik...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:ccHost]]&lt;br /&gt;
[[Category:ccMixter]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Technology]]&lt;br /&gt;
{{cchost_head}}&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
&lt;br /&gt;
Your ccHost site can be configured to look like many different sites with just a few menu selections and no changes to your web server configuration.&lt;br /&gt;
&lt;br /&gt;
=Why?=&lt;br /&gt;
Why do this? Let&amp;#039;s say you are running a remix community as your main site but also want to run a contest or you mainly run contests and you also want to have a personal &amp;#039;media weblog&amp;#039; on the side -- or -- whatever.&lt;br /&gt;
&lt;br /&gt;
Most configuration settings in ccHost are specific to each virtual root. That means each virtual root can have it&amp;#039;s own skin, it&amp;#039;s own menus, home page, admins, page content, navigator tabs, rules for file naming, MP3/ID3 tagging, etc., etc.&lt;br /&gt;
&lt;br /&gt;
By default a virtual root will inherit settings from the main root (media) until you override them. This is a very powerful feature but can lead to plenty of confusion if not taken into account when dealing with virtual roots. (Prediction: you will forget this admonition, then you&amp;#039;ll get frustrated, then you&amp;#039;ll remember it and we can say &amp;#039;I told you so.&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=Default Virtual Root (&amp;#039;media&amp;#039;)=&lt;br /&gt;
The default virtual root is called &amp;#039;&amp;#039;&amp;#039;media&amp;#039;&amp;#039;&amp;#039;. You can not delete this root, you can add your own. Every ccHost command in a URL starts with the virtual root. If you don&amp;#039;t supply one then &amp;#039;&amp;#039;&amp;#039;media&amp;#039;&amp;#039;&amp;#039; is assumed.&lt;br /&gt;
&lt;br /&gt;
For example, for sites with pretty URLs turned off:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com?ccm=/media/submit&amp;lt;/nowiki&amp;gt; // pretty URLs off&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/media/submit&amp;lt;/nowiki&amp;gt;      // pretty URLs ON&lt;br /&gt;
&lt;br /&gt;
Is the same as&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com?ccm=/submit&amp;lt;/nowiki&amp;gt;  // pretty URLs off&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/submit&amp;lt;/nowiki&amp;gt;       // pretty URLs ON&lt;br /&gt;
&lt;br /&gt;
However, if you want to execute the &amp;#039;&amp;#039;&amp;#039;submit&amp;#039;&amp;#039;&amp;#039; command in another virtual root you&amp;#039;ll have to specify that:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com?ccm=/my_virtual_root/submit&amp;lt;/nowiki&amp;gt;  // pretty URLs off&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/my_virtual_root/submit&amp;lt;/nowiki&amp;gt;       // pretty URLs ON&lt;br /&gt;
&lt;br /&gt;
==Name Conflicts==&lt;br /&gt;
If you [[cchost/concepts/Content|create a document]] called &amp;#039;&amp;#039;bobby&amp;#039;&amp;#039; you can view the file with:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/media/docs/bobby&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;#039;&amp;#039;&amp;#039;media&amp;#039;&amp;#039;&amp;#039; is the default virtual root you can also see it with:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/docs/bobby&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;#039;&amp;#039;&amp;#039;docs&amp;#039;&amp;#039;&amp;#039; is the default command you &amp;#039;&amp;#039;also&amp;#039;&amp;#039; see it with:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/bobby&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can see why naming your virtual root &amp;#039;&amp;#039;&amp;#039;bobby&amp;#039;&amp;#039;&amp;#039; will be a conflict. If you did that, ccHost would consider the URL above to be a request to go the home page of the &amp;#039;&amp;#039;&amp;#039;bobby&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It would be equally bad to call your virtual root &amp;#039;&amp;#039;&amp;#039;docs&amp;#039;&amp;#039;&amp;#039; (or any other [[Cchost/concepts/Commands|command]] for that matter) because you would be disabling that command for the &amp;#039;&amp;#039;&amp;#039;media&amp;#039;&amp;#039;&amp;#039; root (the virtual root has precedence).&lt;br /&gt;
&lt;br /&gt;
=Creating a Virtual Root=&lt;br /&gt;
&lt;br /&gt;
To create a new virtual root go to &amp;#039;&amp;#039;Global Settings&amp;#039;&amp;#039; -&amp;gt; &amp;#039;&amp;#039;Virtual ccHost&amp;#039;&amp;#039; (or browse to &amp;#039;&amp;#039;&amp;#039;admin/cfgroot&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The only initial requirement will be the core name of the new virtual root. Make it a good one because it will be seen in many hundreds of URLs. Make it short, lowercase, alpha only, easy to type (&amp;#039;aqz&amp;#039; is not easy to type, try it) but descriptive like &amp;#039;albums&amp;#039; or &amp;#039;cindysart&amp;#039;.&lt;br /&gt;
=See Your Virtual Root=&lt;br /&gt;
After naming the virtual root you can then use that name in the URL address to access it. For example, let&amp;#039;s say you name your new root myroot, to access that root simply tack it on to the domain and directory:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com?ccm=/myroot&amp;lt;/nowiki&amp;gt; // Pretty URLs off&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;http://example.com/myroot&amp;lt;/nowiki&amp;gt;      // Pretty URLs ON&lt;br /&gt;
&lt;br /&gt;
=Setting Properties in a Virtual Root=&lt;br /&gt;
#Log in as admin (if not already)&lt;br /&gt;
#Click on &amp;#039;&amp;#039;Manage Site&amp;#039;&amp;#039;&lt;br /&gt;
#Select your virtual from the drop-down at the top of the form&lt;br /&gt;
&lt;br /&gt;
You will now be setting configuration values for your virtual root.&lt;br /&gt;
&lt;br /&gt;
=Deleting a Virtual Root=&lt;br /&gt;
&lt;br /&gt;
#Log in as an admin (if not already)&lt;br /&gt;
#Click on &amp;#039;&amp;#039;Manage Site&amp;#039;&amp;#039; (or browse to &amp;#039;&amp;#039;&amp;#039;admin/site/local&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
#Select the virtual root from the &amp;#039;&amp;#039;Edit the settings for virtual root&amp;#039;&amp;#039; drop down &lt;br /&gt;
#click on the &amp;#039;&amp;#039;Delete this virtual root&amp;#039;&amp;#039; button&lt;br /&gt;
=Developers=&lt;br /&gt;
&lt;br /&gt;
==Determining the Current Virtual Root==&lt;br /&gt;
The ccHost runtime will put the current virtual root into a global called &amp;#039;&amp;#039;&amp;#039;$CC_GLOBAL_ROOT&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
So if you code is saving some root specific data, say to a browser cookie:&lt;br /&gt;
&lt;br /&gt;
  global $CC_CFG_ROOT;&lt;br /&gt;
 &lt;br /&gt;
  $data[&amp;#039;last_vroot&amp;#039;] = $CC_CFG_ROOT;&lt;br /&gt;
  &lt;br /&gt;
This global is available by the time the CC_EVENT_APP_INIT event is triggered.&lt;br /&gt;
&lt;br /&gt;
==Saving Root Specific Settings==&lt;br /&gt;
Read [[Cchost/developer/Common_HOWTO&amp;#039;s#Saving_and_retrieving_system_configuration_data|this section]] in order to save your own custom configuration settings into different virtual roots.&lt;/div&gt;</summary>
		<author><name>Fourstones</name></author>
	</entry>
</feed>