2

EE v2.5.5 MSM

On the current host the main site and other sites each have their own directory, 'www.oursite.com' points to one directory, 'subdomain1.oursite.com' points to it's own directory etc.

This setup doesn't seem possible on our new host, so we have put the main site into the public_html directory, and created subdomain directories in public_html into which the other sites have been put.

I have followed the instructions for setting up the paths in MSM; in the subdomains directories both the admin.php and index.php $system_path value points to the main sites system directory.

I thought I could reach the control panels via subdomain1.oursite.com/admin.php etc, but it's actually the main cp, requests for the subdomain frontends fail.

I don't think this is an open basedir issue is it? Any other ideas please?

Update, I've added my htaccess details here in reponse to the comment from Jeremy Gimbel: I have the following in my htaccess for the subsite1 directory:

--------------- htaccess rediect ----------

RewriteEngine On 
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-da 
RewriteRule ^(.*)$ /index.php?/$1 [L] 
RewriteCond %{HTTP_HOST} ^www.subsite1.domain.com 
RewriteRule ^(.*)$ subsite1.domain.com/$1 [R=301,L] 
RewriteCond %{HTTPS} !=on 
RewriteRule ^ http s://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

------------- end htaccess redirect ----------

I'm not sure if lines 6/7 are doing the right thing?

4
  • Look at your htaccess files. Sometimes they get a little confused when you're using a subdomain in a subdirectory of the docroot. Commented Nov 22, 2013 at 20:40
  • Can you make that an edit to your question, so it's more readable? Commented Nov 24, 2013 at 21:32
  • I think the issue may be with line 5. You may need to include the subdirectory for the site before the index.php Commented Nov 25, 2013 at 13:24
  • Adding the subdirectory there causes aserver 500 error
    – wot
    Commented Nov 25, 2013 at 14:21

1 Answer 1

1

Who are you hosting with? Do you not have the option to create subdomains in the control panel? Once you create the appropriate subdomains and establish those folders through the CP, the rest should take care of itself like on your other/existing server.

I've run into some issues in the past when firewalls were involved with MSM setups and cookie/session issues due to CORS, but you should be able to just set relative paths in your index and admin files to point and go unless I am missing what is happening here.

Example: I have the following:

  • system folder
    • behind root
  • site.com
    • public html folder
      • admin.php
        • points to system folder
      • index.php
  • sub1.site.com
    • public html folder (where my host placed it)
      • admin.php
        • points to system folder
      • index.php
  • sub2.site.com
    • public html folder (where my host placed it)
      • admin.php
        • points to system folder
      • index.php
  • sub3.site.com
    • public html folder (where my host placed it)
      • admin.php
        • points to system folder
      • index.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.