• Resolved Stewart C Baker

    (@thestripedone)


    Hello,

    I’ve read through the other threads like this with similar titles, but none seem to resolve my issue.

    I recently installed Multisite on a friend’s page, and his wordpress (3.61) is in a /wp/ subdirectory. After installing multisite, I can access all the dashboard stuff for his original wordpress page just fine, but for some reason the network admin pages are not picking up on that subdirectory. Instead of directing me to http://foo.com/wp/wp-admin/network/ they point me at http://foo.com/wp-admin/network/ which nets me a 404.

    Here’s my htaccess

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]
    RewriteRule ^(.*\.php)$ wp/$1 [L]
    RewriteRule . index.php [L]

    and here’s my wp-config.php multisite section:

    /* Multisite */
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'foo.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    I’ve tried changing PATH_CURRENT_SITE to /wp/ but it gets me a redirect loop (again–ONLY for network admin).

    I’ve also switched themes and turned off all the plugins, but it didn’t seem to make a difference.

    Anybody have any ideas about how I can get multisite to recognize that /wp/ is the WordPress directory, and that it needs to go before everything else?

Viewing 10 replies - 1 through 10 (of 10 total)
  • his wordpress (3.61) is in a /wp/ subdirectory.

    How were you accessing the site’s home page earlier? As foo.com or foo.com/wp/

    If you were accessing the home page and other posts through the subdirectory you won’t be able to install Multisite as subdomain.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    Were you using the trick to give WordPress its own directory?

    Thread Starter Stewart C Baker

    (@thestripedone)

    The home page is accessed through foo.com; however, when I try to access wp-admin, it redirects me to foo.com/wp/wp-login.php

    Were you using the trick to give WordPress its own directory?

    I didn’t install the initial WordPress, but it does appear that this is the case. The WP files are not in the root directory (which is actually a subdirectory on a shared webspace, I think, and also not the real root directory).

    I’ll set the subdomain option to false and see if that fixes things. Thanks for your suggestions!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    The home page is accessed through foo.com; however, when I try to access wp-admin, it redirects me to foo.com/wp/wp-login.php

    Okay for the record you CAN use subdomains like this. Most of the time.

    Try this .htaccess

    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    Thread Starter Stewart C Baker

    (@thestripedone)

    Thanks, Mika.

    I’ve tried that and am still getting the same error when I try to access the network admin pages.

    However, I also stumbled across this old support forum thread which pretty neatly summed up the problem I was having and which suggested putting the rewrite rules in the ROOT DIRECTORY’s .htaccess file. That and your suggested .htaccess above did the trick–at least for getting the site to recognize that I was trying to get into /wp/wp-admin/network/ instead of /wp-admin/network/. I still wasn’t able to use the multisite setup as a subdomain install, but that’s really not an issue as we’re fine with subdirectories.

    With that, I was able to create two new sites: foo.com/test/ and foo.com/testtwo/

    Now I have a different set of problems:

    • Trying to access the newly installed subdirectory site at foo.com/test/ loads the content, but none of the CSS
    • Trying to access the dashboards for everything except the /network/ and main site gives me a redirect loop

    If you haven’t created any content on the newly created sites I would suggest doing everything again.

    Backup your existing database and files, follow these instructions to uninstall WordPress multisite.

    Then follow this guide (instructions under “Using a pre-existing subdirectory install”).

    Now try installing Multisites for subdomains.

    Thread Starter Stewart C Baker

    (@thestripedone)

    Thanks, Jesin.

    I think that suggestion is probably the best. Unfortunately, I’m not sure I can get access to the SQL tables since my friend’s site is hosted elsewhere. I’ll have him ask his host to give that a shot.

    You can use the wpdb class to execute drop queries. Place the following code in your theme’s functions.php:

    add_action( 'wp_ajax_drop_ms', 'uninstall_ms' );
    
    function uninstall_ms() {
        global $wpdb;
        var_dump( $wpdb->query( 'DROP TABLE IF EXISTS wp_blogs, wp_blog_versions, ...' ) );
        die;
    }

    Login to WordPress and access – http://foo.com/wp/wp-admin/admin-ajax.php?action=drop_ms

    This should return bool(true). Remove the code once done.

    Sagar

    (@supportguru)

    Hello,

    Rather that doing this stuffs, just tell your hosting provider to change the directory root & they’ll fix it up for you.
    Now regarding the admin login url, please change the site URL & home URL by adding them to the wp-config.php

    Thread Starter Stewart C Baker

    (@thestripedone)

    The guy who runs my friend’s web hosting is just going to start us off with a fresh WP install, so I’m going to mark this as “resolved” even though I never did get it to work with what we already had.

    Starting over is often the best solution!

    Thanks all for your help. πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Multisite Network Admin 404’ is closed to new replies.