Changeset 591

Show
Ignore:
Timestamp:
06/22/06 18:31:50 (2 years ago)
Author:
donncha
Message:

Moved everything in wp-inst down a directory.
Uses's Ryan Boren's htaccess rules and mods
If you're upgrading, try this on a test server first!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/htaccess.dist

    r575 r591  
    1 #php_flag register_globals 0 
    2 #php_flag display_errors 0 
    31RewriteEngine On 
    42RewriteBase BASE/ 
     
    86RewriteRule ^(.*)       http://%1/$1 [R,L] 
    97 
    10 ### 
    11 #### blogs 
    12 ### 
    13 RewriteRule ^([_0-9a-zA-Z-]+)/templates/(.*)                    BASE/wp-inst/wp-content/blogs/$1/templates/$2 [L] 
    14 RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*)                        BASE/wp-inst/wp-content/blogs.php?file=$1 [L] 
    15 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*)  BASE/wp-inst/wp-content/blogs.php?file=$3 [L] 
    16 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/themes/(.*)            BASE/wp-inst/wp-content/themes/$2 [L] 
    17 RewriteRule ^wp-content/themes/(.*)             BASE/wp-inst/wp-content/themes/$1 [L] 
     8#uploaded files 
     9RewriteRule ^files/(.*) wp-content/blogs.php?file=$1 [L] 
    1810 
    19 # rewrite these 
    20 RewriteRule ^([_0-9a-zA-Z-]+)/category/(.*)/page/(.*)/                  BASE/wp-inst/index.php?wpblog=$1&category_name=$2&paged=$3 [L] 
    21 RewriteRule ^([_0-9a-zA-Z-]+)/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&category_name=$2&feed=$3 [L] 
    22 RewriteRule ^([_0-9a-zA-Z-]+)/category/?(.*)                            BASE/wp-inst/index.php?wpblog=$1&category_name=$2 [L] 
    23  
    24 RewriteRule ^([_0-9a-zA-Z-]+)/tag/(.*)/page/(.*)/                       BASE/wp-inst/index.php?wpblog=$1&category_name=$2&paged=$3 [L] 
    25 RewriteRule ^([_0-9a-zA-Z-]+)/tag/(.*)/(feed|rdf|rss|rss2|atom)/?$      BASE/wp-inst/wp-feed.php?wpblog=$1&category_name=$2&feed=$3 [L] 
    26 RewriteRule ^([_0-9a-zA-Z-]+)/tag/?(.*)                                 BASE/wp-inst/index.php?wpblog=$1&category_name=$2 [L] 
    27  
    28 RewriteRule ^([_0-9a-zA-Z-]+)/author/(.*)/(feed|rdf|rss|rss2|atom)/?$   BASE/wp-inst/wp-feed.php?wpblog=$1&author_name=$2&feed=$3 [L] 
    29 RewriteRule ^([_0-9a-zA-Z-]+)/author/?(.*)                              BASE/wp-inst/index.php?wpblog=$1&author_name=$2 [L] 
    30 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-zA-Z-]+)?/?([0-9]+)?/?$                 BASE/wp-inst/index.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5&page=$6 [L] 
    31 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-zA-Z-]+)/(feed|rdf|rss|rss2|atom)/?$        BASE/wp-inst/wp-feed.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5&feed=$6 [L] 
    32 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-zA-Z-]+)/trackback/?$                       BASE/wp-inst/wp-trackback.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5 [L] 
    33 RewriteRule ^([_0-9a-zA-Z-]+)/page/?([0-9]+)?/?$                        BASE/wp-inst/index.php?paged=$2 [L] 
    34 RewriteRule ^([_0-9a-zA-Z-]+)/feed/?([_0-9a-zA-Z-]+)?/?$                BASE/wp-inst/wp-feed.php?wpblog=$1&feed=$2 [L] 
    35 RewriteRule ^([_0-9a-zA-Z-]+)/comments/feed/?([_0-9a-zA-Z-]+)?/?$       BASE/wp-inst/wp-feed.php?wpblog=$1&feed=$2&withcomments=1 [L] 
    36 RewriteRule ^([_0-9a-zA-Z-]+)/archives/p/([0-9]+)/?(.*)?                BASE/wp-inst/index.php?wpblog=$1&redirect=yes&p=$2 [L] 
    37 RewriteRule ^([_0-9a-zA-Z-]+)/archives/cat/([0-9]+)/?(.*)?              BASE/wp-inst/index.php?wpblog=$1&redirect=yes&cat=$2 [L] 
    38 RewriteRule ^([_0-9a-zA-Z-]+)/archives/m/([0-9]+)\#?(.*)?               BASE/wp-inst/index.php?wpblog=$1&redirect=yes&m=$2 [L] 
    39 RewriteRule ^([_0-9a-zA-Z-]+)/b2rss2.php(.*)?                           BASE/wp-inst/wp-feed.php?wpblog=$1&feed=rss2 [L] 
    40 RewriteRule ^([_0-9a-zA-Z-]+)/b2rdf.php(.*)?                            BASE/wp-inst/wp-feed.php?wpblog=$1&feed=rdf [L] 
    41  
    42 # We want to pass these files straight through 
    43 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*)          BASE/wp-inst/wp-comments-post.php          [L] 
    44 RewriteRule ^([_0-9a-zA-Z-]+)/pages/(.*)                        BASE/wp-inst/pages/$2 [L] 
    45 RewriteRule ^([_0-9a-zA-Z-]+)/wp-admin/(.*)                     BASE/wp-inst/wp-admin/$2 [L] 
    46 RewriteRule ^([_0-9a-zA-Z-]+)/wp-atom.php(.*)                   BASE/wp-inst/wp-atom.php [L] 
    47 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-popup.php(.*)         BASE/wp-inst/wp-comments-popup.php [L] 
    48 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*)          BASE/wp-inst/wp-comments-post.php [L] 
    49 RewriteRule ^([_0-9a-zA-Z-]+)/wp-commentsrss2.php(.*)           BASE/wp-inst/wp-commentsrss2.php [L] 
    50 RewriteRule ^([_0-9a-zA-Z-]+)/wp-counter.php(.+)?               BASE/wp-inst/wp-counter.php [L] 
    51 RewriteRule ^([_0-9a-zA-Z-]+)/wp-feed.php(.*)                   BASE/wp-inst/wp-feed.php [L] 
    52 RewriteRule ^([_0-9a-zA-Z-]+)/wp-images/(.*)                    BASE/wp-inst/wp-images/$2 [L] 
    53 RewriteRule ^([_0-9a-zA-Z-]+)/wp-links-opml.php(.*)             BASE/wp-inst/wp-links-opml.php [L] 
    54 RewriteRule ^([_0-9a-zA-Z-]+)/wp-login.php(.*)                  BASE/wp-inst/wp-login.php [L] 
    55 RewriteRule ^([_0-9a-zA-Z-]+)/wp-mail.php(.*)                   BASE/wp-inst/wp-mail.php [L] 
    56 RewriteRule ^([_0-9a-zA-Z-]+)/wp-pass.php(.*)                   BASE/wp-inst/wp-pass.php [L] 
    57 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rdf.php(.*)                    BASE/wp-inst/wp-rdf.php [L] 
    58 RewriteRule ^([_0-9a-zA-Z-]+)/wp-register.php(.*)               BASE/wp-inst/wp-register.php [L] 
    59 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rss.php(.*)                    BASE/wp-inst/wp-rss.php [L] 
    60 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rss2.php(.*)                   BASE/wp-inst/wp-rss2.php [L] 
    61 RewriteRule ^([_0-9a-zA-Z-]+)/wp-sidebar.php(.*)                BASE/wp-inst/wp-sidebar.php [L] 
    62 RewriteRule ^([_0-9a-zA-Z-]+)/wp-trackback.php(.*)              BASE/wp-inst/wp-trackback.php [L] 
    63 RewriteRule ^([_0-9a-zA-Z-]+)/wp-cron.php(.*)                   BASE/wp-inst/wp-cron.php [L] 
    64 RewriteRule ^([_0-9a-zA-Z-]+)/xmlrpc.php(.*)                    BASE/wp-inst/xmlrpc.php [L]    
    65 RewriteRule ^([_0-9a-zA-Z-]+)/maintenance.php                   BASE/wp-inst/maintenance.php [L]    
    66 RewriteRule ^([_0-9a-zA-Z-]+)/favicon.ico                       BASE/wp-inst/favicon.ico [L]    
    67 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/images/(.*)           BASE/wp-inst/wp-includes/images/$2 [L] 
    68 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/js/(.*)               BASE/wp-inst/wp-includes/js/$2 [L] 
    69  
    70 RewriteRule ^wp-comments-post.php                               BASE/wp-inst/wp-comments-post.php [L] 
    71 RewriteRule ^wp-signup.php$                                     BASE/wp-inst/wp-signup.php [L] 
    72 RewriteRule ^wp-activate.php$                                   BASE/wp-inst/wp-activate.php [L] 
    73 RewriteRule ^wp-login.php                                       BASE/wp-inst/wp-login.php [L] 
    74 RewriteRule ^wp-admin/(.*)                                      BASE/wp-inst/wp-admin/$1 [L] 
    75 RewriteRule ^wp-includes/images/(.*)                            BASE/wp-inst/wp-includes/images/$1 [L] 
    76 RewriteRule ^wp-includes/js/(.*)                                BASE/wp-inst/wp-includes/js/$1 [L] 
    77 RewriteRule ^signup/                                            BASE/wp-inst/wp-newblog.php [L] 
    78 RewriteRule ^invite/(.*)/?                                      BASE/wp-inst/wp-newblog.php?u=$1 [L] 
    79 RewriteRule ^index.php                                          BASE/wp-inst/index.php [L] 
    80  
    81 RewriteRule ^$                                                  BASE/wp-inst/index.php [L] 
    82  
    83 # catch all rules 
    84 RewriteRule ^([_0-9a-zA-Z-]+)/                                  BASE/wp-inst/index.php [L] 
    85 RewriteRule ^([_0-9a-zA-Z-]+)                                   $1/ [R,L] 
    86  
    87 AddType text/css .css 
     11RewriteCond %{REQUEST_FILENAME} -f [OR] 
     12RewriteCond %{REQUEST_FILENAME} -d 
     13RewriteRule . - [L] 
     14RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] 
     15RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
     16RewriteRule . index.php [L] 
  • trunk/index-install.php

    r589 r591  
    5858<body> 
    5959 
    60 <h1><img src="wp-inst/wp-includes/images/wordpress-mu.png" alt="WordPress MU" /></h1> 
     60<h1><img src="wp-includes/images/wordpress-mu.png" alt="WordPress MU" /></h1> 
    6161'; 
    6262} 
     
    172172    $ret = true; 
    173173    $ret = check_writeable_dir( dirname(__FILE__), $ret ); 
    174     $ret = check_writeable_dir( dirname(__FILE__) . "/wp-inst", $ret ); 
    175     $ret = check_writeable_dir( dirname(__FILE__) . "/wp-inst/wp-content/", $ret ); 
     174    $ret = check_writeable_dir( dirname(__FILE__) . "/wp-content/", $ret ); 
    176175 
    177176    if( $ret == false ) 
     
    207206 
    208207    // Create Blogs living area. 
    209     @mkdir( dirname(__FILE__) . "/wp-inst/wp-content/blogs.dir", 0777 ); 
     208    @mkdir( dirname(__FILE__) . "/wp-content/blogs.dir", 0777 ); 
    210209 
    211210 
     
    224223 
    225224function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'password', $dbhost = 'localhost', $prefix = 'wp_' ) { 
     225        $weblog_title = 'My new WPMU Blog'; 
     226        $email = ''; 
     227        $hostname = str_replace( "www.", "", $_SERVER[ 'HTTP_HOST' ] ); 
    226228    print " 
    227229    <form method='post' action='index.php'>  
     
    253255    </tr> 
    254256  </table>  
     257  <h2>Server Address</h2> 
     258  <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.<br /><b>Server Address:</b> <input type='text' name='basedomain' value='{$hostname}'></label></p> 
     259  <h2>Blog Details</h2> 
     260  <table width='100%'>  
     261  <tr>  
     262  <th scope='row'>Weblog&nbsp;Title</th>  
     263  <td><input name='weblog_title' type='text' size='45' value='".$weblog_title."' /></td>  
     264  <td>What would you like to call your weblog? </td>  
     265  </tr>  
     266  <tr>  
     267  <th scope='row'>Email</th>  
     268  <td><input name='email' type='text' size='45' value='".$email."' /></td>  
     269  <td>Your email address.</td>  
     270  </tr>  
     271  </table>  
    255272  <p class='submit'><input name='submit' type='submit' value='Submit' /> </p> 
    256273</form> "; 
     
    258275 
    259276function step2() { 
     277        global $wpdb, $table_prefix, $base, $blog_id; 
    260278    $dbname  = $_POST['dbname']; 
    261279    $uname   = $_POST['uname']; 
     
    275293    define('DB_HOST', $dbhost); 
    276294 
    277     if (!file_exists('wp-inst/wp-config-sample.php')) 
     295    if (!file_exists('wp-config-sample.php')) 
    278296        die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 
    279297 
    280     $configFile = file('wp-inst/wp-config-sample.php'); 
     298    $configFile = file('wp-config-sample.php'); 
    281299    // We'll fail here if the values are no good. 
    282     require_once('wp-inst/wp-includes/wp-db.php'); 
     300    require_once('wp-includes/wp-db.php'); 
    283301    printheader(); 
    284302 
    285303    print "Creating Database Config File: "; 
    286304     
    287     $handle = fopen('wp-inst/wp-config.php', 'w'); 
     305    $handle = fopen('wp-config.php', 'w'); 
    288306 
    289307    foreach ($configFile as $line_num => $line) { 
     
    316334    } 
    317335    fclose($handle); 
    318     chmod('wp-inst/wp-config.php', 0666); 
     336    chmod('wp-config.php', 0666); 
    319337    print "<b style='color: #00aa00; font-weight: bold'>DONE</b><br />"; 
    320338} 
     
    326344        <input type='hidden' name='action' value='step3'> 
    327345        <p>To finish setting up your blog, please fill in the following form and click <q>Submit</q>.</p> 
    328         <h2>Server Address</h2> 
    329         <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.<br /><b>Server Address:</b> <input type='text' name='basedomain' value='{$hostname}'></label></p> 
    330         <h2>Blog Details</h2> 
    331         <table width='100%'>  
    332         <tr>  
    333         <th scope='row'>Weblog&nbsp;Title</th>  
    334         <td><input name='weblog_title' type='text' size='45' value='".$weblog_title."' /></td>  
    335         <td>What would you like to call your weblog? </td>  
    336         </tr>  
    337         <tr>  
    338         <th scope='row'>Email</th>  
    339         <td><input name='email' type='text' size='45' value='".$email."' /></td>  
    340         <td>Your email address.</td>  
    341         </tr>  
    342         </table>  
    343346        <input name='submit' type='submit' value='Submit' />  
    344347        </form>  
     
    406409        case "step2": 
    407410                // get blog username 
    408                 // create wp-inst/wp-config.php  
     411                // create wp-config.php  
    409412                step2(); 
    410                 printuserdetailsform(); 
     413                // Install Blog! 
     414                include_once('./wp-config.php'); 
     415                include_once('./wp-admin/upgrade-functions.php'); 
     416                make_db_current_silent(); 
     417                populate_options(); 
     418                do_htaccess( 'htaccess.dist', '.htaccess', $base, ''); 
     419                printheader(); 
     420                step3(); 
    411421        break; 
    412422        case "step3": 
     
    414424                // create .htaccess 
    415425                // print login info and links. 
    416                 require_once('./wp-inst/wp-config.php'); 
    417                 require_once('./wp-inst/wp-admin/upgrade-functions.php'); 
     426                require_once('./wp-config.php'); 
     427                require_once('./wp-admin/upgrade-functions.php'); 
    418428                make_db_current_silent(); 
    419429                populate_options(); 
     
    424434        default: 
    425435                // check that directories are writeable. 
    426                 // create wp-inst/wpmu-settings.php 
     436                // create wpmu-settings.php 
    427437                // get db auth info. 
    428438                printheader(); 
    429439                if( step1() ) { 
    430                 printstep1form(); 
     440                       printstep1form(); 
    431441                } 
    432442        break; 
  • trunk/wp-admin/admin-functions.php

    r587 r591  
    10871087// Returns true on write success, false on failure. 
    10881088function insert_with_markers($filename, $marker, $insertion) { 
     1089        return true; 
    10891090        if (!file_exists($filename) || is_writeable($filename)) { 
    10901091                if (!file_exists($filename)) { 
  • trunk/wp-blog-header.php

    r13 r591  
    55        if ( strstr( $_SERVER['PHP_SELF'], 'wp-admin') ) $path = ''; 
    66        else $path = 'wp-admin/'; 
    7     die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='{$path}setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file."); 
     7        include( "index-install.php" ); // install WPMU! 
     8        die(); 
    89} 
    910 
  • trunk/wp-signup.php

    r589 r591  
    172172 
    173173function validate_another_blog_signup() { 
    174         global $current_user, $current_site
     174        global $current_user
    175175 
    176176        $result = validate_blog_form(); 
     
    185185        $meta = array ('lang_id' => 'en', 'public' => $public); 
    186186 
    187         wpmu_create_blog($domain, $current_site->path, $blog_title, $current_user->id, $meta); 
    188         confirm_another_blog_signup($domain, $current_site->path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);           
     187        wpmu_create_blog($domain, $path, $blog_title, $current_user->id, $meta); 
     188        confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);                 
    189189} 
    190190 
     
    192192?> 
    193193<h2><?php printf(__('%s Is Yours'), $domain.$path ) ?></h2> 
    194 <p><?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog.  <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, $domain.$path . "wp-login.php", $user_name) ?></p> 
     194<p><?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog.  <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name) ?></p> 
    195195<?php 
    196196        do_action('signup_finished'); 
  • trunk/wpmu-settings.php

    r586 r591  
    3333                $blogname = htmlspecialchars( str_replace( $path, '', $_SERVER[ 'REQUEST_URI' ] ) ); 
    3434                $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) ); 
    35                 if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' ) { 
     35                if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' ) { 
    3636                        $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'"); 
    3737                } else { 
    38                         $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$blogname.$domain' AND path = '$path'"); 
     38                        $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '{$path}{$blogname}/'"); 
    3939                } 
    4040        }