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.

Quick Question about MSM

October 14, 2008 6:37pm

Subscribe [2]
  • #1 / Oct 14, 2008 6:37pm

    gmg_admin

    14 posts

    I read the documentation and I was unable to find an answer to my question. Hopefully it’s a simple answer.

    If I have two websites in two different directories (http://www.mysite.com/ee/siteA and www.mysite.com/ee/siteB) with the system folder residing in the “ee” directory, do I need to move two duplicate instances of my “scripts” and “themes” folders to each directory?

    I was loading my pages and noticed that because i was using the {site_url} tag it was referencing links to images as http://www.mysite.com/ee/siteA/themes/images etc. instead of http://www.mysite.com/ee/themes/images

    I don’t mind having duplicate folders but just don’t want to run into any problems later down the road.

    Thanks in advance.

  • #2 / Oct 14, 2008 6:45pm

    Ingmar

    29245 posts

    What exactly do you mean, two different directories? Are you installing EE more than once? Are “siteA” and “SiteB” subdirectories? If you use the MSM, you certainly don’t have to install EE twice.

    Also, what version and build are you on?

  • #3 / Oct 14, 2008 7:06pm

    gmg_admin

    14 posts

    Well currently my root directory called “ee” looks like this with the following files and folders.

    siteA (folder)
    siteB (folder)
    system (folder)
    images (folder)
    license.txt
    scripts (folder)
    themes (folder)

    ============

    The SiteA sub folder has the following folders & files:
    index.php
    path.php
    scripts (folder *duplicate from root)
    themes (folder * duplicate from root)

    ============

    SiteB folder looks exactly the same as the SiteA folder with the same duplicated scripts and themes folder.

    ============

    In the admin console the root address specifies where the index.php file resides which isn’t necessarily the true root of the site since they are sub folders. So if I use {site_url}themes/images etc. in my template to point to a particular image, it’s going to give me the wrong addy. (http://www.mysite.com/ee/SiteA/themes/images instead of http://www.mysite.com/ee/themes/images). Thus I guess my only choice is to quit using site_url and just use the full static address if I want to point to stuff on the true root level.

    Hopefully that makes sense.

    And to answer your question, i’m using the latest build. 1.6 I believe.

    Thanks for bearing with me.

  • #4 / Oct 14, 2008 8:02pm

    Greg Aker

    6022 posts

    Have you tried to set “URL to the root directory of your site” and “URL to your “themes” folder” in Admin ›  System Preferences ›  General Configuration for both sites? 

    -greg

  • #5 / Oct 15, 2008 3:53pm

    gmg_admin

    14 posts

    My admin settings for website A are as follows:

    URL to the root directory: http://mywebsite.com/ee/siteA/
    URL to control panel: http://mywebsite.com/ee/system/index.php
    URL to themes folder: http://mywebsite.com/ee/siteA/themes/

    So for an example, when i use {site_url} tags to link an external .js file the code look likes this under the current settings: http://mywebsite.com/ee/siteA/scripts/sample.js

    But really i want it to look like this: http://mywebsite.com/ee/scripts/sample.js

    If i’m able to do this then technically i wouldn’t have to have two scripts directories in both the website A and B sub folders. Both websites could then share assets from a single upload directory as well.

    Is there something i’m doing wrong in my settings?

  • #6 / Oct 15, 2008 8:38pm

    Greg Aker

    6022 posts

    Sorry, I’m not completely grasping how you are set up here.  Please let me know if I have this right.

    main site url is:

    http://example.com/ee/sitea/

    using MSM, you have created a website called “siteb” on a url like:  http://example.com/ee/siteb/

    If you visit http://example.com/ee/sitea/ in your browser, you get the first site displayed, and the same for your second site…right?

  • #7 / Oct 16, 2008 1:19am

    gmg_admin

    14 posts

    It’s ok, I appreciate you taking the time to try to make some sense of my ramblings. Right now there is no main site per say. It’s just http://example.com/ee/sitea and http://example.com/ee/siteb

    The system folder, main images folder, and themes folder is located in the ee directory (http://example.com/ee/) I also have one more folder named scripts which contains all my external javascript code.

    After installing MSM i made two sub folders called sitea and siteb. Each of these two folders contain their own instances of index.php and path.php. In addition to those two files, I had to duplicate the theme folder and scripts folder found in the EE root folder in order for the site to properly display when using the {site_url} tags. I was just wondering if this would be considered the proper way to install two sites on one server?

  • #8 / Oct 16, 2008 10:43am

    Robin Sowell

    13255 posts

    The {site_url} tag is always going to pick up on your ‘site url’ as specified in ‘Admin- System Prefs- General Config’, but that doesn’t mean you can’t put your scripts folder elsewhere.  I’d just create a global variable that points one level up and use that to link to scripts/etc.  Ditto sharing an upload folder- you’d just need to specify the correct folder in the ‘Admin- Weblog Admin- File upload prefs’.  The theme folder should work the same way- you specify it in ‘General Prefs’.

    That help at all?  You shouldn’t have to duplicate the theme folder if you don’t want to.  I don’t believe most folks do.  I prefer to have separate upload folders/script folders/etc. for each site as I tend to have each site w/its own domain and prefer all scripts/images/etc. come from that domain.  But that’s a personal preference.

  • #9 / Oct 16, 2008 12:46pm

    gmg_admin

    14 posts

    Thank you for the info. That does make sense to have separate folders incase there is a possibility that the sites end up having their own domain as you stated. I just needed reassurance that what I was doing the correct way to do things, which is probably arbitrary since it’s probably up to user preference.

    I will do a little more research on global variables. I didn’t know you could point to stuff one level up or down. Thanks!

  • #10 / Oct 16, 2008 12:56pm

    Robin Sowell

    13255 posts

    Yep- it pretty much boils down to user preference.  With subdomains/subfolders, I like to have one catchall usually.  But with multiple domains, I like to have one for each.  But that’s just me.  As long as it works?  It’s pure personal preference.

    I’m going to leave this open while you poke about with it.  And if you try to setup up a certain way and run into trouble?  Post back and we’ll figure out what’s up.

  • #11 / Oct 16, 2008 4:02pm

    gmg_admin

    14 posts

    Great thank you.

  • #12 / Oct 16, 2008 6:27pm

    Ingmar

    29245 posts

    gmg, does that solve the issue for you? You’re all set?

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

ExpressionEngine News!

#eecms, #events, #releases