ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

The best way to setup my website folders when using MSM

May 02, 2011 1:48pm

Subscribe [3]
  • #1 / May 02, 2011 1:48pm

    glenndavisgroup

    436 posts

    I’m looking for some info on how I should setup my folders for my websites when using MSM. I’m new to EE all together and would appreciate any input the community can give me. We are currently using EE 2.1.3 with MSM. Any help is appreciated.

    Thank you,

    Mike

  • #2 / May 02, 2011 2:44pm

    Boyink!

    5011 posts

    Are you running MSM to drive separate domains, subdomains, or the same site in folders?

  • #3 / May 02, 2011 3:09pm

    glenndavisgroup

    436 posts

    Hi Boyink,

    Thanks for the quick reply. I’m trying to setup multiple separate domains.

    Thank you,

    Mike

  • #4 / May 02, 2011 3:13pm

    Boyink!

    5011 posts

    I usually just create a subfolder off the root for each MSM site, and have the domain mapped directly to that folder.

  • #5 / May 02, 2011 4:14pm

    glenndavisgroup

    436 posts

    Do I need to do anything from EE’s end to tell it where this site is? Is it as simple as going into each site and changing the Admin > Global Preference information?

    Mike

  • #6 / May 02, 2011 4:17pm

    Boyink!

    5011 posts

    The MSM Docs have a pretty good step by step process for creating a new site and the server work required.

  • #7 / May 02, 2011 4:43pm

    glenndavisgroup

    436 posts

    Boyink,

    Thanks for the info. I will try it and let you know how it goes.

    Thank you,

    Mike

  • #8 / May 02, 2011 5:34pm

    glenndavisgroup

    436 posts

    Boyink,

    So I tried the doc and I’m having some issues. I’m trying to do the following. I have 3 domains as an example:

    abc.com
    def.com
    ghi.com

    I want to setup each of the domains in it’s own folder. Right now I setup a new folder in the root called:

    abc.com

    I’ve configured the settings and preferences for abc.com in the cpanel to point to the right directory etc. Currently I have my JS, CSS, and Images for abc.com in folders that are located in the root as well. Everything is working great. But I want to move the JS, CSS, and Images folders in the abc.com folder so that it’s more organized for each website just like how we do for standard website. Is there a way to do this in the cpanel or is this something I have to do with mod_rewrite to achieve this?

    Thanks for your help.

    Mike

  • #9 / May 02, 2011 8:06pm

    Boyink!

    5011 posts

    All I’ve ever done is:

    - Create the abc.com/images (for example) folder
    - Create a File Upload Destination (if applicable)
    - Modify all paths used in templates & code in the new/additional MSM site to look at the new folder

    It’s pretty straightforward.  Is there a specific step/situation that’s tripping you up?

  • #10 / May 02, 2011 10:42pm

    Marcus Neto

    1005 posts

    glenndavisgroup,

    One step that may be resulting in your issue is defining the site_url in the index.php file that resides in the folder in question. You will want to uncomment out the following lines and fill them in with the right information

    //  $assign_to_config[‘site_name’] = ‘’;
    //  $assign_to_config[‘cp_url’] = ‘’;
    //  $assign_to_config[‘site_url’] = ‘’;

    From there when you use {site_url} to point to a css file it will point to that particular site URL. So {site_url}css/main.css will point to abc.com/css/main.css.

  • #11 / May 03, 2011 1:25pm

    glenndavisgroup

    436 posts

    Hi Guys,

    Thank you both for your reply. The problem I’m having is this. When I setup the site and folder for abc.com in the root and put the css, js, images etc. in that folder. Non of my references for image, css, and js etc. are working when viewing the website. So for example the following is not working:

    http://abc.com/css/style.css

    I get a 404 file not found. The only way it works is if I call it like this:

    http://www.abc.com/abc.com/css/style.css

    I tried setting the global var $assign_to_config[...] values but I’m getting this error:

    Site Error: Unable to Load Site Preferences; No Preferences Found

    The only way I got it to work was to setup a condition and rule in the .htaccess file for the following:

    RewriteCond $1 \.(css|js|swf|gif|jpe?g|png|ico)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /abc.com/$1 [L]

    Not sure which way is the right way.

    Thank you,

    Mike

  • #12 / May 03, 2011 1:41pm

    Boyink!

    5011 posts

    Should the domain be mapped one folder deeper?

  • #13 / May 03, 2011 1:50pm

    glenndavisgroup

    436 posts

    Here is the structure:

    /abc.com
    - /css
    - /js
    - /images
    - /abc
      |—/site.group
      |——index.html
      |——aboutus.html
      |—/includes.group
      |——top_header
    - index.php

    I kept this structure since after the install I started working on the site then realized I was doing it wrong and moved the /abc folder from the system > templates > abc folder. Maybe this is my problem. Should I move “site.group” and “includes.group” to the root of /abc.com?

    Mike

  • #14 / May 03, 2011 1:55pm

    Boyink!

    5011 posts

    Well - it’s a bit fuzzy since I’m not sure what the site/includes folders are for.  With EE you shouldn’t need content-specific folders on the server like that since EE will pick up the request and look to it’s own templates library.  Even if you save templates as files they typically go into their own folder that doesn’t show in the URL.

  • #15 / May 03, 2011 2:00pm

    Boyink!

    5011 posts

    Just for reference, I use MSM on http://boyink.com and http://boyinks4adventure.com.

    Here is the folder structure:

    Boyink.com:
    index.php
    path.php

    /js
    /css
    /system
    /images
    /themes
    /rv_adventure (boyinks4adventure.com)
      index.php
      path.php
      /css
      /images
      /js


    My EE templates live in the database so they are not stored at the file level.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases