WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] The ol' redirect loop. Can't access dashboard. (4 posts)

  1. gpspake
    Member
    Posted 1 year ago #

    I've read about this for hours and tried everything I could find but I'm having no luck.

    I added a site to my multisite installation and I can't get to the dashboard. I get a redirect loop.

    I understand this is an htaccess issue and I think I have a pretty good understanding of what is happening (Thanks to this guy) but I can't manage to get it working.

    I should note that I am not having the same problem on an identical server with the exact same configuration and settings.

    My .conf file is as follows...

    # BEGIN WordPress
    <Directory /var/www/html>
    
    AllowOverride All
    
    <IfModule mod_rewrite.c>
    
            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).*) $2 [L]
    #RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . index.php [L]
    
    </IfModule>
    </Directory>
    # END WordPress

    Any suggestions?

  2. gpspake
    Member
    Posted 1 year ago #

    Ok, so I uncommented this line and it's sort of working
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]

    But now I have an even stranger issue. If I'm in the dashboard for the site I just added and I hover over 'my sites' only network admin and the primary site show up. If I'm in the primary site dashboard or network admin and I hover over it, I see both sites listed. This really isn't to much of an issue but I think it could be indicative of some larger issue.

  3. gpspake
    Member
    Posted 1 year ago #

    Wow. A response from the master. I'm not worthy.
    Man what a headache.

    There are so many threads about this but it's usually a multi-factor problem which makes it very difficult to provide any sort of definitive answer, but after about 30 minutes of going back and forth we realized that the working site had a second .conf file on the server that was added by the person who originally set it up. Now that we are enlightened to this fact it explains some separate issues we were having with that installation. whew.

    Anyway, once we realized that there was another conf file on the working-site server, we were able to see what was going on and modify the one that wasn't working.

    So kids,
    There's no end all solution for this. It depends on your specific configuration and installation. (Also make sure you don't have a .conf file or .htaccess file that could be impacting something else. The version you were on when you installed multisite is also a factor.
    Always listen to Ipstenu, in the end, this codex page is the key.

    http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite

    Here's how it came out.

    <Directory /var/www/html/>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    #RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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]
    
    #This will be different for multisites installed from 3.5 or later
    #http://codex.wordpress.org/Multisite_Network_Administration
    #should use next 2 lines
    #RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) wp/$2 [L]
    #RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ wp/$2 [L]
    
    #Currently started @ 3.4 so we need next 2 lines
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    
    RewriteRule . index.php [L]
    
    #this section pushes all stuff into wordpress rewrite.
    # need to find a way to remove select subdirectories so that other things can be installed
    #RewriteRule !^(special(/.*)?|collector\.html)$ collector.html [R,L]
    
    </IfModule>
    # END WordPress
    </Directory>

Topic Closed

This topic has been closed to new replies.

About this Topic