[wp-trac] Re: [WordPress Trac] #2866: WP can't be used from a
single source installation
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 31 01:30:12 GMT 2006
#2866: WP can't be used from a single source installation
-------------------------+--------------------------------------------------
Reporter: RuddO | Owner: anonymous
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: General | Version:
Severity: normal | Resolution: worksforme
Keywords: |
-------------------------+--------------------------------------------------
Changes (by mdawaffe):
* resolution: => worksforme
* status: new => closed
Comment:
In the past, I've used a custom wp-config.php to do something similar.
There may be some webserver configuration issues.
wp-config.php
{{{
<?php
define('DB_USER', 'username');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'host');
define('ABSPATH', dirname(__FILE__).'/');
define ('WPLANG', '');
if ( 0 === strpos($_SERVER['HTTP_HOST'], 'one.example.com') ) :
define('DB_NAME', 'one');
$table_prefix = 'wp_';
define('CACHE_PATH', ABSPATH . 'wp-content/cache1/');
elseif ( 0 === strpos($_SERVER['HTTP_HOST'], 'one-more.example.com') ) :
define('DB_NAME', 'one');
$table_prefix = 'wp_more_';
define('CACHE_PATH', ABSPATH . 'wp-content/cache1more/');
elseif ( 0 === strpos($_SERVER['HTTP_HOST'], 'two.example.com') ) :
define('DB_NAME', 'two');
$table_prefix = 'wp_';
define('CACHE_PATH', ABSPATH . 'wp-content/cache2/');
else :
define('DB_NAME', 'main');
$table_prefix = 'wp_';
endif;
require_once(ABSPATH.'wp-settings.php');
?>
}}}
You can also define the cookie and custom table constants where
appropriate. I think there may have been a couple other caveats such as
making sure the upload directories were distinct.
Then have a web root dir {{{one}}}
{{{
.htaccess
index.php
wordpress@ -> /wherever/wordpress/
}}}
with an index.php
{{{
<?php
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?>
}}}
/wherever/wordpress/ contains a standard WP install with that custom wp-
config.php.
Set !WordPress URL = "!http://one.example.com/wordpress"
Set Blog URL = "!http://one.example.com"
No core mods necessary.
But, since WP isn't really designed with this in mind, I'm going to close
the ticket.
--
Ticket URL: <http://trac.wordpress.org/ticket/2866>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list