[wp-trac] [WordPress Trac] #24563: Allow multiple sites on a common code-base

WordPress Trac noreply at wordpress.org
Wed Jun 12 01:42:49 UTC 2013


#24563: Allow multiple sites on a common code-base
-----------------------------+-----------------------------
 Reporter:  ergonlogic       |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  trunk
 Severity:  normal           |   Keywords:  has-patch
-----------------------------+-----------------------------
 It would be nice to be able to run multiple independent WordPress sites on
 a common code-base. I'm not talking about the multisite feature, but
 rather what's documented here:
 http://codex.wordpress.org/Installing_Multiple_Blogs.

 Since we can already keep our wp-config.php separate from the WordPress
 code-base, this can be accomplished with symlinks, and a simple patch
 (attached). Basically, the file structure could look something like:

     /var/www/wordpress-3.5
     /var/www/example.com
     /var/www/example.com/wp-config.php
     /var/www/example.com/wordpress -> /var/www/wordpress-3.5/
     /var/www/example.org
     /var/www/example.org/wp-config.php
     /var/www/example.org/wordpress -> /var/www/wordpress-3.5/

 The vhosts would then look like this:

     <VirtualHost *:80>
     ServerName example.com
     DocumentRoot /var/www/example.com/wordpress
     </VirtualHost>

 and:

     <VirtualHost *:80>
     ServerName example.org
     DocumentRoot /var/www/example.org/wordpress
     </VirtualHost>

 The patch to wp-load.php simply changes settings ABSPATH from this:

     define( 'ABSPATH', dirname(__FILE__) . '/' );

 to this:

     define( 'ABSPATH', $_SERVER[ 'DOCUMENT_ROOT' ] . '/');

 From my (admittedly limited) testing, this appears to work just fine. With
 a couple small tweaks along the same lines to wp-cli (https://github.com
 /wp-cli/wp-cli/issues/478) it appears to work just fine from the command
 line too. For a bit of background on where I'm coming from with this, see:
 https://drupal.org/node/1044692#comment-7473232.

 I'm relatively new to WordPress, so forgive me if this (or something like
 it) has already been suggested and shot down for some technical reason. I
 haven't seen anything that looks related in searching through the issue
 queue.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24563>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list