Changeset 266
- Timestamp:
- 08/31/05 17:12:51 (3 years ago)
- Files:
-
- trunk/htaccess.dist (modified) (3 diffs)
- trunk/index.php (modified) (4 diffs)
- trunk/wp-inst/wp-content/themes/home (added)
- trunk/wp-inst/wp-content/themes/home/404.php (added)
- trunk/wp-inst/wp-content/themes/home/archive.php (added)
- trunk/wp-inst/wp-content/themes/home/archives.php (added)
- trunk/wp-inst/wp-content/themes/home/comments-popup.php (added)
- trunk/wp-inst/wp-content/themes/home/comments.php (added)
- trunk/wp-inst/wp-content/themes/home/footer.php (added)
- trunk/wp-inst/wp-content/themes/home/header.php (added)
- trunk/wp-inst/wp-content/themes/home/home.php (added)
- trunk/wp-inst/wp-content/themes/home/images (added)
- trunk/wp-inst/wp-content/themes/home/images/kubrickbg.jpg (added)
- trunk/wp-inst/wp-content/themes/home/images/kubrickbgcolor.jpg (added)
- trunk/wp-inst/wp-content/themes/home/images/kubrickbgwide.jpg (added)
- trunk/wp-inst/wp-content/themes/home/images/kubrickfooter.jpg (added)
- trunk/wp-inst/wp-content/themes/home/images/kubrickheader.jpg (added)
- trunk/wp-inst/wp-content/themes/home/index.php (added)
- trunk/wp-inst/wp-content/themes/home/links.php (added)
- trunk/wp-inst/wp-content/themes/home/page.php (added)
- trunk/wp-inst/wp-content/themes/home/screenshot.png (added)
- trunk/wp-inst/wp-content/themes/home/search.php (added)
- trunk/wp-inst/wp-content/themes/home/searchform.php (added)
- trunk/wp-inst/wp-content/themes/home/sidebar.php (added)
- trunk/wp-inst/wp-content/themes/home/single.php (added)
- trunk/wp-inst/wp-content/themes/home/style.css (added)
- trunk/wp-inst/wp-includes/images/wordpress-mu.png (added)
- trunk/wp-inst/wp-includes/wpmu-functions.php (modified) (2 diffs)
- trunk/wp-inst/wp-newblog.php (modified) (1 diff)
- trunk/wp-inst/wp-settings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/htaccess.dist
r254 r266 2 2 RewriteBase BASE/ 3 3 4 ###5 #### main blog6 ###7 8 RewriteRule ^templates/(.*) BASE/wp-inst/wp-content/blogs/main/templates/$1 [L]9 RewriteRule ^files/(.*) BASE/wp-inst/wp-content/blogs/files/$1 [L]10 RewriteRule ^wp-content/themes/(.*) BASE/wp-inst/wp-content/themes/$1 [L]11 12 # rewrite these13 RewriteRule ^category/(.*)/page/(.*)/ BASE/wp-inst/index.php?wpblog=main&category_name=$1&paged=$2 [L]14 RewriteRule ^category/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=main&category_name=$1&feed=$2 [L]15 RewriteRule ^category/?(.*) BASE/wp-inst/index.php?wpblog=main&category_name=$1 [L]16 RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=main&author_name=$1&feed=$2 [L]17 RewriteRule ^author/?(.*) BASE/wp-inst/index.php?wpblog=main&author_name=$1 [L]18 RewriteRule ^([0-9]{4})/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-zA-Z-]+)?/?([0-9]+)?/?$ BASE/wp-inst/index.php?wpblog=main&year=$1&monthnum=$2&day=$3&name=$4&page=$5 [L]19 RewriteRule ^([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=main&year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [L]20 RewriteRule ^([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-zA-Z-]+)/trackback/?$ BASE/wp-inst/wp-trackback.php?wpblog=main&year=$1&monthnum=$2&day=$3&name=$4 [L]21 RewriteRule ^page/?([0-9]+)?/?$ BASE/wp-inst/index.php?paged=$1 [L]22 RewriteRule ^feed/?([_0-9a-zA-Z-]+)?/?$ BASE/wp-inst/wp-feed.php?wpblog=main&feed=$1 [L]23 RewriteRule ^comments/feed/?([_0-9a-zA-Z-]+)?/?$ BASE/wp-inst/wp-feed.php?wpblog=main&feed=$1&withcomments=1 [L]24 RewriteRule ^archives/p/([0-9]+)/?(.*)? BASE/wp-inst/index.php?wpblog=main&redirect=yes&p=$1 [L]25 RewriteRule ^archives/cat/([0-9]+)/?(.*)? BASE/wp-inst/index.php?wpblog=main&redirect=yes&cat=$1 [L]26 RewriteRule ^archives/m/([0-9]+)\#?(.*)? BASE/wp-inst/index.php?wpblog=main&redirect=yes&m=$1 [L]27 RewriteRule ^b2rss2.php(.*)? BASE/wp-inst/wp-feed.php?wpblog=main&feed=rss2 [L]28 RewriteRule ^b2rdf.php(.*)? BASE/wp-inst/wp-feed.php?wpblog=main&feed=rdf [L]29 30 # We want to pass these files straight through31 RewriteRule ^wp-comments-post.php(.*) BASE/wp-inst/wp-comments-post.php [L]32 RewriteRule ^go.php(.*) BASE/wp-inst/go.php$1 [L]33 RewriteRule ^pages/(.*) BASE/wp-inst/pages/$1 [L]34 RewriteRule ^wp-admin/(.*) BASE/wp-inst/wp-admin/$1 [L]35 RewriteRule ^wp-atom.php(.*) BASE/wp-inst/wp-atom.php [L]36 RewriteRule ^wp-comments-popup.php(.*) BASE/wp-inst/wp-comments-popup.php [L]37 RewriteRule ^wp-comments-post.php(.*) BASE/wp-inst/wp-comments-post.php [L]38 RewriteRule ^wp-commentsrss2.php(.*) BASE/wp-inst/wp-commentsrss2.php [L]39 RewriteRule ^wp-counter.php(.+)? BASE/wp-inst/wp-counter.php [L]40 RewriteRule ^wp-feed.php(.*) BASE/wp-inst/wp-feed.php [L]41 RewriteRule ^wp-images/(.*) BASE/wp-inst/wp-images/$1 [L]42 RewriteRule ^wp-includes/images/(.*) BASE/wp-inst/wp-includes/images/$1 [L]43 RewriteRule ^wp-includes/js/(.*) BASE/wp-inst/wp-includes/js/$1 [L]44 RewriteRule ^wp-links-opml.php(.*) BASE/wp-inst/wp-links-opml.php [L]45 RewriteRule ^wp-login.php(.*) BASE/wp-inst/wp-login.php [L]46 RewriteRule ^wp-mail.php(.*) BASE/wp-inst/wp-mail.php [L]47 RewriteRule ^wp-pass.php(.*) BASE/wp-inst/wp-pass.php [L]48 RewriteRule ^wp-rdf.php(.*) BASE/wp-inst/wp-rdf.php [L]49 RewriteRule ^wp-register.php(.*) BASE/wp-inst/wp-register.php [L]50 RewriteRule ^wp-rss.php(.*) BASE/wp-inst/wp-rss.php [L]51 RewriteRule ^wp-rss2.php(.*) BASE/wp-inst/wp-rss2.php [L]52 RewriteRule ^wp-sidebar.php(.*) BASE/wp-inst/wp-sidebar.php [L]53 RewriteRule ^wp-trackback.php(.*) BASE/wp-inst/wp-trackback.php [L]54 RewriteRule ^xmlrpc.php(.*) BASE/wp-inst/xmlrpc.php [L]55 RewriteRule ^maintenance.php BASE/wp-inst/maintenance.php [L]56 RewriteRule ^favicon.ico /wp-inst/favicon.ico [L]57 RewriteRule ^robots.txt /wp-inst/robots.txt [L]58 59 RewriteRule ^wp-newblog.php BASE/wp-inst/wp-newblog.php [L]60 RewriteRule ^signup/ BASE/wp-inst/wp-newblog.php [L]61 RewriteRule ^invite/(.*)/? BASE/wp-inst/wp-newblog.php?u=$1 [L]62 RewriteRule ^index.php BASE/wp-inst/index.php [L]63 64 RewriteRule ^$ BASE/wp-inst/index.php [L]65 4 66 5 ### … … 71 10 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) BASE/wp-inst/wp-content/blogs/$1/files/$3 [L] 72 11 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/themes/(.*) BASE/wp-inst/wp-content/themes/$2 [L] 12 RewriteRule ^wp-content/themes/(.*) BASE/wp-inst/wp-content/themes/$1 [L] 73 13 74 14 # rewrite these … … 114 54 RewriteRule ^([_0-9a-zA-Z-]+)/xmlrpc.php(.*) BASE/wp-inst/xmlrpc.php [L] 115 55 RewriteRule ^([_0-9a-zA-Z-]+)/maintenance.php BASE/wp-inst/maintenance.php [L] 116 RewriteRule ^([_0-9a-zA-Z-]+)/favicon.ico /wp-inst/favicon.ico [L] 56 RewriteRule ^([_0-9a-zA-Z-]+)/favicon.ico BASE/wp-inst/favicon.ico [L] 57 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/images/(.*) BASE/wp-inst/wp-includes/images/$2 [L] 58 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/js/(.*) BASE/wp-inst/wp-includes/js/$2 [L] 117 59 118 # pages 119 RewriteCond REALPATH/wp-inst/wp-content/blogs/%{1} -d 120 RewriteRule ^([_0-9a-zA-Z-]+)/(.*)/$ BASE/wp-inst/index.php?pagename=$2 [L] 60 RewriteRule ^wp-newblog.php$ BASE/wp-inst/wp-newblog.php [L] 61 RewriteRule ^wp-login.php BASE/wp-inst/wp-login.php [L] 62 RewriteRule ^wp-admin/(.*) BASE/wp-inst/wp-admin/$1 [L] 63 RewriteRule ^wp-includes/images/(.*) BASE/wp-inst/wp-includes/images/$1 [L] 64 RewriteRule ^wp-includes/js/(.*) BASE/wp-inst/wp-includes/js/$1 [L] 65 RewriteRule ^signup/ BASE/wp-inst/wp-newblog.php [L] 66 RewriteRule ^invite/(.*)/? BASE/wp-inst/wp-newblog.php?u=$1 [L] 67 RewriteRule ^index.php BASE/wp-inst/index.php [L] 121 68 122 RewriteRule ^ (.*)/$ BASE/wp-inst/index.php?pagename=$1[L]69 RewriteRule ^$ BASE/wp-inst/index.php [L] 123 70 124 71 # catch all rules 125 RewriteCond REALPATH/wp-inst/wp-content/blogs/%{1} -d126 72 RewriteRule ^([_0-9a-zA-Z-]+)/ BASE/wp-inst/index.php [L] 127 128 RewriteRule ^([_0-9a-zA-Z-]+)/(.+)$ BASE/wp-inst/$2 [L] 129 130 RewriteCond %{REQUEST_FILENAME} -d 131 RewriteRule ^(.+[^/])$ BASE/ [R,L] 132 RewriteCond REALPATH/wp-inst/wp-content/blogs/%{1} -d 133 RewriteRule ^(.*[^/])$ BASE/$1/ [R,L] 73 RewriteRule ^([_0-9a-zA-Z-]+) $1/ [R,L] 134 74 135 75 AddType text/css .css trunk/index.php
r264 r266 62 62 <body> 63 63 64 <div align="center"><img src="wp-inst/wp-i mages/wordpress-mu.png"></div><br>64 <div align="center"><img src="wp-inst/wp-includes/images/wordpress-mu.png"></div><br> 65 65 Welcome to WordPress MU, the Multi User Weblog System built on WordPress.<br><br> 66 66 '; … … 263 263 <p>Each blog on your site will have their own hostname or 'sub domain'. Your blog addresses will appear like <span class='fakelink'>http://joesblog.example.com/</span> instead of <span class='fakelink'>http://www.example.com/joesblog/</span> but you need to do a few more things to Apache and your DNS settings before it'll work.</p> 264 264 <p>Apache will have to have a <q>wildcard</q> alias configured in the virtual server definition of your server. You'll have to add a wildcard DNS record for your domain too. That's usually as easy as adding a <q>*</q> hostname in your online dns software.</p> 265 <p>Virtual Server Support: <input type='radio' name='vhost' value='yes'> Yes <input type='radio' name='vhost' value='no' checked>No</p> 265 266 <p>More: <ul><li> <a href='http://codewalkers.com/archives/general_admin/234.html'>Sub-domain catch-all with Apache</a> via <a href='http://www.google.com/search?q=apache+wildcard+alias'>Google Search: apache wildcard alias</a></li><li> <a href='http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/'>Wildcard dns and sub domains</a> via <a href='http://www.google.com/search?q=dns+wildcard+sub+domain'>Google Search: dns wildcard sub domain</a></li><li><a href='http://mu.wordpress.org/forums/topic/126#post-677'>mu forums: how to setup vhosts</a></li></ul></p> 266 267 <br /> … … 350 351 break; 351 352 case "define('VHOST', ": 352 fwrite($handle, str_replace("VHOSTSETTING", 'yes', $line));353 fwrite($handle, str_replace("VHOSTSETTING", $vhost, $line)); 353 354 break; 354 355 case '$table_prefix =': … … 429 430 if( $res == 'ok' ) { 430 431 $url = "http://".$_SERVER["HTTP_HOST"] . $base; 431 $realpath = dirname(__FILE__); 432 do_htaccess( "htaccess.dist", ".htaccess", $realpath, $base, $url ); 433 do_htaccess( "wp-inst/htaccess.dist", "wp-inst/.htaccess", $realpath, $base, $url ); 434 435 $illegal_names = array( "www", "web", "root", "admin", "main", "invite", "administrator", "blog" ); 436 add_site_settings( "illegal_names", $illegal_names ); 437 438 print "<p>Well Done! Your blog has been set up and you have been sent details of your login and password in an email.</p>"; 439 print "<p>You may view your new blog by visiting <a href='".$url."'>".$url."</a>!</p>"; 432 update_option( "template", "home" ); 433 update_option( "stylesheet", "home" ); 434 add_site_option( "allowed_themes", 'a:2:{s:17:"WordPress Classic";b:1;s:17:"WordPress Default";b:1;}' ); 435 $realpath = dirname(__FILE__); 436 do_htaccess( "htaccess.dist", ".htaccess", $realpath, $base, $url ); 437 do_htaccess( "wp-inst/htaccess.dist", "wp-inst/.htaccess", $realpath, $base, $url ); 438 439 $illegal_names = array( "www", "web", "root", "admin", "main", "invite", "administrator", "blog" ); 440 add_site_settings( "illegal_names", $illegal_names ); 441 442 print "<p>Well Done! Your blog has been set up and you have been sent details of your login and password in an email.</p>"; 443 print "<p>You may view your new blog by visiting <a href='".$url."'>".$url."</a>!</p>"; 440 444 } else { 441 445 if( $res == 'error: problem creating blog entry' ) { trunk/wp-inst/wp-includes/wpmu-functions.php
r264 r266 163 163 $url = "http://".$domain.$path; 164 164 } else { 165 if( $blogname == 'main' ) { 166 $url = "http://".$domain.$path; 167 } else { 168 $url = "http://".$domain.$path.$blogname; 169 } 165 if( $domain != $_SERVER[ 'HTTP_HOST' ] ) { 166 $blogname = substr( $domain, 0, strpos( $domain, '.' ) ); 167 if( $blogname != 'www.' ) { 168 $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path . $blogname . '/'; 169 } else { // we're installing the main blog 170 $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path; 171 } 172 } else { // we're installing the main blog 173 $url = 'http://' . $domain . $path; 174 } 170 175 } 171 176 … … 251 256 $message_headers = 'From: ' . stripslashes($weblog_title) . ' <wordpress@' . $_SERVER[ 'SERVER_NAME' ] . '>'; 252 257 $message = $welcome_email; 258 if( empty( $current_site->site_name ) ) 259 $current_site->site_name = "WordPress MU"; 253 260 @mail($admin_email, __('New ' . $current_site->site_name . ' Blog').": ".stripslashes( $weblog_title ), $message, $message_headers); 254 261 trunk/wp-inst/wp-newblog.php
r131 r266 96 96 $result = dirname( $_SERVER["SCRIPT_NAME"] ); 97 97 $result = str_replace("wp-inst","",$result); 98 /* 98 99 if( strlen( $result > 1 ) && substr($result, -1 ) == '/') { 99 100 $result = substr($result, 0, -1); 100 101 } 102 */ 101 103 102 104 return $result; trunk/wp-inst/wp-settings.php
r255 r266 94 94 } 95 95 } 96 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$base'"); 96 if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) { 97 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$base'"); 98 } else { 99 if( $base == '/' ) { 100 $wpblog = substr( $_SERVER[ 'REQUEST_URI' ], 1 ); 101 } else { 102 $wpblog = str_replace( $base, '', $_SERVER[ 'REQUEST_URI' ] ); 103 } 104 if( strpos( $wpblog, '/' ) ) 105 $wpblog = substr( $wpblog, 0, strpos( $wpblog, '/' ) ); 106 if( $wpblog == '' || file_exists( ABSPATH . $wpblog ) || is_dir( ABSPATH . $wpblog ) ) { 107 $searchdomain = $domain; 108 } else { 109 $searchdomain = $wpblog . "." . $domain; 110 } 111 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '{$searchdomain}' AND path = '$base'"); 112 } 97 113 if( $current_blog == false ) { 98 114 is_installed(); … … 114 130 } 115 131 116 if( $current_site->domain == $domain && $current_site->path == $base ) {117 $wpblog = 'main';118 }119 132 if( $blog_id == false ) { 120 133 // no blog found, are we installing? Check if the table exists.
