WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Issues with MU:Subdirectories (admin redirect loop) (2 posts)

  1. vaccal
    Member
    Posted 1 year ago #

    Fresh install of WordPress 3.5 and MultiSite.

    The install is located directly in the 'web' folder, AKA the root.

    Chose subdirectories during the install, added the following lines of code to .htaccess and wp-config respectively.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
    RewriteRule . index.php [L]
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'localhost');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Using these settings allows me to access the main site and it's wp-admin. It allows me to access the subdirectory (which appears without styling mind you) but when I try to access the wp-admin for subdir, I get the admin redirect loop.

    I double checked, and I'm pretty sure mod_rewrite is enabled (I tryed a simple redirect rule in the .htaccess)

    For reference,

    lucavacca.me

    lucavacca.me/projects/

    Thanks for any help on the subject, first time using MU.

  2. vaccal
    Member
    Posted 1 year ago #

    I have fixed my own problem, wanted to share it here incase others are having the same issue.

    Notes:

    1. In the WP-CONFIG code I linked earlier, DOMAIN_CURRENT_SITE was set to 'localhost', this was erroneous, I was messing around with stuff and forgot to change it back. It should have read www.lucavacca.me
    2. I used the code that the WordPress codex supplies, but I think this might be wrong for people using MultiSite in the root directory of their site.

    Changing

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]

    To

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ /$2 [L]

    i.e removing wp from in front of /$2

    Has seem to have solved my problems. It was driving me insane, I didn't notice the extra characters in front. Marking as resolved, PM me if anyone needs help with this, think I have a good grasp now.

Topic Closed

This topic has been closed to new replies.

About this Topic