diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-31 17:12:51 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-31 17:12:51 +0000 |
| commit | b97ffeeb3d4ac57c41e3884c949eca65e427da39 (patch) | |
| tree | 033ae7853239a0dd0b9a725fef2dd33f5921b70f /wp-inst/wp-settings.php | |
| parent | f0b71c9b71ed231ce98e1b6863e724f330afdaee (diff) | |
Major overhaul of rewrite rules, "main" blog now displays a "home" page.
Hopefully non-vhost install is working again.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@266 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-settings.php')
| -rw-r--r-- | wp-inst/wp-settings.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/wp-inst/wp-settings.php b/wp-inst/wp-settings.php index 0654802..14cdbb2 100644 --- a/wp-inst/wp-settings.php +++ b/wp-inst/wp-settings.php @@ -93,7 +93,23 @@ function is_installed() { die( "<h1>Fatal Error</h1> " . $msg ); } } -$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$base'"); +if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) { + $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$base'"); +} else { + if( $base == '/' ) { + $wpblog = substr( $_SERVER[ 'REQUEST_URI' ], 1 ); + } else { + $wpblog = str_replace( $base, '', $_SERVER[ 'REQUEST_URI' ] ); + } + if( strpos( $wpblog, '/' ) ) + $wpblog = substr( $wpblog, 0, strpos( $wpblog, '/' ) ); + if( $wpblog == '' || file_exists( ABSPATH . $wpblog ) || is_dir( ABSPATH . $wpblog ) ) { + $searchdomain = $domain; + } else { + $searchdomain = $wpblog . "." . $domain; + } + $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '{$searchdomain}' AND path = '$base'"); +} if( $current_blog == false ) { is_installed(); } @@ -113,9 +129,6 @@ if( $current_site->site_name == false ) { include( ABSPATH . "wp-admin/wpmu-upgrade.inc.php" ); } -if( $current_site->domain == $domain && $current_site->path == $base ) { - $wpblog = 'main'; -} if( $blog_id == false ) { // no blog found, are we installing? Check if the table exists. if ( defined('WP_INSTALLING') ) { |
