** Pastebin PRO Accounts Easter Special ** Get 40% discount for a limited time only! Click Here to check it out ;-)Want more features on Pastebin? Sign Up, it's FREE!

testing WordPress 3.5 multisite in its own directory

By: buffler on Nov 29th, 2012  |  syntax: None  |  size: 3.39 KB  |  views: 194  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. - uploaded 3.4.2 files to domain.com/wp/, setup /wp/wp-config.php, visited domain.com/wp/ to install
  2. - logged in, installed WordPress Beta Tester plugin, set to bleeding edge nightlies, updated
  3. - set 'site address' ('home' in db) to domain.com
  4. - copied index.php from /wp/ to root, added '/wp' to require path
  5. - verified site loading at domain.com
  6. - added define('WP_ALLOW_MULTISITE', true); to /wp/wp-config.php
  7. - deactivated WordPress Beta Tester plugin, visited Tools > Network Setup, chose sub-directories, clicked 'Install', was given the following:
  9.   1. Add the following to your wp-config.php file in /server-path-to-domain-root/wp/ above the line reading /* That’s all, stop editing! Happy blogging. */:
  11.   define('MULTISITE', true);
  12.   define('SUBDOMAIN_INSTALL', false);
  13.   define('DOMAIN_CURRENT_SITE', 'domain.com');
  14.   define('PATH_CURRENT_SITE', '/');
  15.   define('SITE_ID_CURRENT_SITE', 1);
  16.   define('BLOG_ID_CURRENT_SITE', 1);
  18.   2. Add the following to your .htaccess file in /server-path-to-domain-root/wp/, replacing other WordPress rules:
  20.   RewriteEngine On
  21.   RewriteBase /
  22.   RewriteRule ^index\.php$ - [L]
  24.   # add a trailing slash to /wp-admin
  25.   RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
  27.   RewriteCond %{REQUEST_FILENAME} -f [OR]
  28.   RewriteCond %{REQUEST_FILENAME} -d
  29.   RewriteRule ^ - [L]
  30.   RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
  31.   RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
  32.   RewriteRule . index.php [L]
  34. - logged in. appears fine; I'm at domain.com/wp/wp-admin/
  35.   - all current site links include '/wp'; network links in admin bar omit '/wp', and, other than 'view network' (just domain.com), 404
  36.   - if I visit domain.com/wp-admin/, url is rewritten to domain.com/wp/wp-admin/
  37.   - if I visit domain.com/wp/wp-admin/network/, I can access the network dashboard - but,
  38.     - all lefthand menu items link to /wp/wp-admin/network/* admin pages, but all admin bar links still omit '/wp' and 404
  39.     - if I visit 'Sites' (domain.com/wp/wp-admin/network/sites.php), 'Add new' link omits '/wp', and 404s
  40.     - if I visit 'Sites > Add New' (directly via the submenu), I'm at /wp/wp-admin/network/site-new.php and can enter new site settings, but the 'add site' form's action is for /wp-admin/network/site-new.php, and so it 404s on submission
  42. - deleted .htaccess in wp install dir (as there wasn't one, prior to network setup), put those rewrite rules in root-level .htaccess instead
  43.   - went to site admin; I'm at domain.com/wp/wp-admin/
  44.   - same as before, all current site links include '/wp'; network links in admin bar omit '/wp', but this time they are accessible.
  45.   - if I visit domain.com/wp-admin/, it appears to work the same as domain.com/wp/wp-admin/ - all links and forms on the various admin pages include '/wp' in their urls, but they work the same as they do when you're at /wp-admin/
  46.   - I can create new sites just fine.
  47.     - visiting the original site admin, urls are '/wp/wp-admin/...'; after creating a new site ('site1') and visiting domain.com/site1 admin, all urls are '/site1/wp-admin/...'
  48.     - all site frontends and admins load just fine, and everything appears to work correctly.
  50. * conclusion: rewrite rules are correct, but ought to be included in the root-level .htaccess file, not in the WordPress install directory (per this comment: http://core.trac.wordpress.org/ticket/19796#comment:38 )
clone this paste RAW Paste Data