• Resolved Andrew Ryan

    (@andy_intermediate)


    Hi all,
    I’m trying to set up multisite on localhost.

    The primary site works fine (front-end and admin back-end) but the secondary sites have no theme for front-end and I cannot access their back-end, they cause an infinite redirect loop.

    I’ve read the many similar posts but had no luck so far with any of their solutions.
    I’ve also read the codex pages:
    http://codex.wordpress.org/Create_A_Network etc

    Environment:
    -Windows XP
    -Fresh XAMPP (1.8.2) and WP(3.9.1) installations

    Steps so far:
    (as per http://wpebooks.com/wp-content/uploads/downloads/2011/08/CreateAWordPressNetwork.pdf)

    1. Enabled Multisite settings via wp-config.php

    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', '127.0.0.1');
    define('PATH_CURRENT_SITE', '/wordpress/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    2. Inserted generated code into .htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    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]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    3. Modifed httpd.conf
    I’d read that this problem could be caused by Apache not reading .htaccess so tried to insert the line “AllowOverride FileInfo Options” at various places in httpd.conf and restarting Apache. No luck.

    Directory Structure:
    XAMPP installation: C:\xampp
    WP installatin: C:\xampp\apps\wordpress

    Other Info:
    -All WP plugins disabled
    -phpMyAdmin shows secondary sites are successfully created in DB
    -Primary Site: localhost/wordpress
    -Secondary Site: localhost/wordpress/test

    Any help would be greatly appreciated. 🙂
    Thanks in advance.
    -Andy

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You edited the WP-config in steps, right? Not all one go?

    Did you flush the browser cache?

    http://halfelf.org/2012/multisite-login-loop/ has more suggestions.

    Thread Starter Andrew Ryan

    (@andy_intermediate)

    Hi Ipstenu and thanks for the response.

    Yes, I edited wp-config.php in steps as per http://codex.wordpress.org/Create_A_Network

    I flushed all the browser cache and tried Firefox, Chrome and IE. All present the same problem of secondary site back-ends being unavailable due to infinite redirect.

    I had a look at my hosts file in ../drivers/etc it contains a few sites being directed to 127.0.0.1 and so I also tried a blank host file, but still same issue.

    Is there anything else you think I could try?
    Is there a way I can output whats going on to see the problem?

    Thanks is advance

    Thread Starter Andrew Ryan

    (@andy_intermediate)

    I’m managed by trial and error to get it to work, but not sure why.

    I edited the file C:\xampp\apps\wordpress\conf\httpd-app.conf

    <Directory "C:/xampp/apps/wordpress/htdocs">
        Options +MultiViews +FollowSymLinks
        AllowOverride None
    
        <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
        </IfVersion>
        <IfVersion >= 2.3>
        Require all granted
        </IfVersion>
    
        RewriteEngine On
        RewriteBase /wordpress/
        RewriteRule ^index\.php$ - [S=1]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /wordpress/index.php [L]
    
    </Directory>

    I simply changed AllowOverride None to AllowOverride All and it now appears to work.

    Edit:
    And also strangely, XAMPP is running so much faster now. It used to take ~5 seconds while “waiting for localhost”, now it’s almost instant. Strange…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multisite localhost XAMPP subfolders infinite redirect loop’ is closed to new replies.