Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:28:16+00:00 2026-05-23T00:28:16+00:00

I have decided to start coding using OOP and a PHP framework. I have

  • 0

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.

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.

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.

top level site – /home/mark/public_html/{website one files}
top level site – /home/mark/public_html/website-two.com/{website-two files}
top level site – /home/mark/public_html/website-three.com/{website-three files}
my sub domains – /home/mark/public_html/sub1.website-three.com/{sub files}
my sub domains – /home/mark/public_html/sub2.website-three.com/{sub2 files}
my sub domains – /home/mark/public_html/sub3.website-three.com/{sub3 files}

I have Yii installed at: /home/mark/Yii

I have created a webapp at: /home/mark/public_html/sub1.website-three.com and access the Yii webapp locally at http://sub1.website-three/ ….I don’t use http://localhost since I have virtual hosts and sub domains. All of this works, and will be creating more webapps at other subdomains under website-three.

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???

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:28:17+00:00Added an answer on May 23, 2026 at 12:28 am

    You can name the protected folder whatever you want and put it anywhere on your file system that your webserver user has access to, so, yes /home/mark/sub*n*_protected scheme would work.

    However, particularly if your sites are similar and have any shared code, it might be more efficient to use one protected folder and set up an array of urlManager rules in your main config file and load the appropriate rules base on the host name. You can then have dedicated controllers for each host as well as views directories. I’ve often done this for mobile versions where you can also add mobile detection to the mix.

    If the sites are distinct, using separate protected directories might sense as well. E.g., I’ll use a separate protected directory for admin tools based on the Gii-generated scaffolding.

    If the sites are very similar, you also might want to check out Themes:
    http://www.yiiframework.com/doc/guide/1.1/en/topics.theming

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have decided to start doing small coding projects on my own that focus
I am a PHP developer exploring the outside world. I have decided to start
Our project contains 2600 class files and we have decided to start using automated
I've been developing a site using ASP.NET MVC, and have decided to use the
I have been coding using Visual Studio 2005, in VB.NET for a while. No
I recently decided to try some java web development, so I installed xampp, the
I have decided that all my WPF pages need to register a routed event.
I have decided that I really need to get some flowcharts for reverse engineering
I have decided to take up f# as my functional language. My problem: Give
Hey peoples, I've been studying Java for a couple of weeks, and have decided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.