title: How do I setup Yii for multiple subdomains so the protected folder sits outside the document root for each subdomain
body: <p>I have decided to start coding using OOP and a PHP framework. I have successfully installed Yii on a development server and created a webapp. Now, I would like to move the protected folder to a level outside the document root for security reasons. My question is how to do this when there are multiple subdomains that I will also be using Yii with.</p>
  
  <p>I have experience with PHP, but not in an OOP style and this is my initial step into OOP and frameworks. Also, I have a LAMP system installed on Ubuntu for development.</p>
  
  <p>My path structure is below, which matches the production server. I have a top level site and multiple other top level sites and subdomain sites for one of the top level sites.</p>
  
  <p>top level site - /home/mark/public_html/{website one files}<br>
  top level site - /home/mark/public_html/website-two.com/{website-two files}<br>
  top level site - /home/mark/public_html/website-three.com/{website-three files}<br>
  my sub domains - /home/mark/public_html/sub1.website-three.com/{sub files}<br>
  my sub domains - /home/mark/public_html/sub2.website-three.com/{sub2 files}<br>
  my sub domains - /home/mark/public_html/sub3.website-three.com/{sub3 files}</p>
  
  <p>I have Yii installed at: /home/mark/Yii</p>
  
  <p>I have created a webapp at: /home/mark/public_html/sub1.website-three.com and access the Yii webapp locally at <a href="http://sub1.website-three/" rel="nofollow">http://sub1.website-three/</a> ....I don't use <a href="http://localhost" rel="nofollow">http://localhost</a> since I have virtual hosts and sub domains. All of this works, and will be creating more webapps at other subdomains under website-three.</p>
  
  <p>Can I rename the protected folder to sub_protected and place it at /home/mark, and then for my next webapp, name the protected folder sub2_protected and so on? Should I use a different path structure??? Also, I believe I will need to edit the protected/config/main.php for each site to reflect the changes???</p>
  
  <p>Any assistance would be greatly appreciated. Can't wait to get this configured so I can dive further into Yii ...looks very intriguing so far.</p>