Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multisite management discussion
Hi, as I mentioned in my other thread I found and started using GetSimple CMS recently. I have about 10 domains that I want to host with it, and as simple as it may be to install, I didn't want to do it once for each domain (and then upgrade once for each domain when new versions become available).

Looking at the code it seemed like it would be pretty simple to allow a single installation of GetSimple to manage multiple websites, so I went ahead and made the changes. Here's a comparison of my branch on GitHub to the main stable branch:

So in a nutshell, the changes are to insert a modified form of the domain name into the data and backups paths, and also into the sitemap.xml. By modified form I mean I strip the www. (so and will equate to the same site), and I also pass it through _id() to make sure it only contains characters safe for use as a directory name (since from a quick read it looks like $_SERVER['SERVER_NAME'] can sometimes be modified by the user, and we wouldn't want it to be an attack vector).

So for example data/users/ will be data/rickparrishca/users for the domain, or data/googlecom/users for, etc.

This means that a single installation can now be used to manage multiple sites. Each site will have it's own pages, users, settings, etc, but will be able to select from a shared collection of plugins and themes. (So you install a theme once, and then it's immediately available to all sites, and can be enabled/disabled on a per site basis.)

So after making these changes I have a few questions that I'm hoping to start a discussion for:

1) Would anyone else find this useful? I searched and found a thread from 2011 where someone was working on a multisite plugin (that also required changing the core), but it didn't seem to have too much interest.

2) How likely is this to break plugins? Anything using something like ../data/other instead of GSDATAOTHERPATH will be broken, but I don't know how common it is to find hardcoded paths like that in the plugins.

3) Should domain extensions also be trimmed off? I mentioned I trim the www. portion, so and will be treated as the same site. But what about same domain different extension (ie and Right now they'd be treated as different sites, but maybe it makes sense for them to be treated as the same?

Also, it's worth noting that I haven't thoroughly tested the code I linked to above. I originally made my changes on the 24th, but when I looked at them yesterday I realized I made a few (really!) stupid mistakes. So what you're seeing at the link now is from last night and this morning, and so I haven't had much time to test and wouldn't recommend actually using it except for testing purposes.

Thanks for your time,

Users browsing this thread: 1 Guest(s)