Search code examples
cakephpinstallationcakephp-1.3setup-deployment

CakePHP installation on Production with subdomains


I have installled my Cakephp based website on my production site like following way

var/html/  
       app/  
       cake/
       .htaccess etc

Its working perfectly untill I installed Blog. To make it work, I moved my content of blog folder to webroot, now my structure is

var/html/  
       app/  
         webroot/  
           blog/  
       cake/  
       .htaccess etc

This works thanks to those .htacess files
Now I am making a subdomain "m " ie http://www.m.example.com My questions are...

  1. Am I doing it right way?
  2. Should I just move every subdomain etc to webroot?
  3. Should I modify htaccess to acheive followwing structure

    var/html/  
           app/
             webroot/ 
           cake/
          .htaccess  
           blog/
           m/
           subdomain/
    

Solution

  • I would recommend separating them like this. The cake1.3 could be any name you want but the idea is that each framework should have its own descriptive folder.

    This makes it much cleaner and is definitely necessary when you get into adding your projects to repositories like git. Each folder can then have its own .htaccess files and being separately configured in your apache config.

    var/html/  
    
        cake1.3/
           app/ 
             webroot/
           cake/
    
        blog/