Ready to get started?Download WordPress


Fresh Install, subfolder multisite, infinite redirect loop sub-blog login (10 posts)

  1. Carlo Rizzante
    Posted 11 months ago #

    Hello all, and thanks for reading.

    Problem: I cannot manage to run a WordPress Multisite with sub-domain in local (MAMP).

    On the same environment I run few WP Multisite with sub-domains and all of them work smoothly.

    So, here what I do for enabling a WP Multisite with sub-directories (which is very similar to what I do for enabling WP Multisite with sub-domains, for the record).

    Fresh install of WordPress 3.5.2, setup permalinks to "Post Name" (http://mysite.dev/%postname%/), verified that in General Settings "WordPress Address (URL)" and "Site Address (URL)" both point to http://mysite.com, saving all.

    Added the line define('WP_ALLOW_MULTISITE', true); to wp-confing.php

    From there I just follow the instruction for enabling a WordPress Multisite with sub-directories.

    On the Terminal.

    # ## mysite.dev WP Multisite mysite.dev *.mysite.dev mysite.dev/test

    The two last line are due to frustration and I tried almost everything I could think of.

    For MAMP I setup the Apache Port at 80, and MySQL Port at 3306. Then I added a specific config file, where I setup the virtual server.

    <virtualHost *:80>
    	ServerName mysite.dev
    	ServerAlias mysite.dev *.mysite.dev
    	DocumentRoot "/Users/carlorizzante/Dropbox/Development/vhosts/mysite.dev/"
    	<directory "/Users/carlorizzante/Dropbox/Development/vhosts/mysite.dev/">
    		Options Indexes FollowSymLinks Includes
    		AllowOverride All
    		Order allow,deny
    		Allow from all
    	CustomLog "/Users/carlorizzante/Dropbox/Development/logs/mysite.dev-access.log" common
    	ErrorLog "/Users/carlorizzante/Dropbox/Development/logs/mysite.dev-errors.log"

    In the end, the main site works smoothly. The sub-sites load the content, but not the styles, so they are broken. And trying to move to the Dashboard of one of the sub-site gives a redirection loop error.

    Any idea? Thanks in advance.

  2. Why are you vhosting for the subfolders?

    There should be no extra work needed for that if you're just installing in mysite.dev and making subsites at mysite.dev/sitename

    (By the way, your URLs will be mysite.dev/blog/postname for the main site)

  3. Carlo Rizzante
    Posted 11 months ago #

    Hello Ipstenu, and thanks for your reply.

    Should it make any difference the reason why? In order to replicate what has to go live, I need a multisite with sub-directories.

    And the default procedure to create a Multisite with sub-directories simply fails in local. At least for me.

  4. It matters because you don't need to vhost subfolders in this context. tl;dr: You're solving a problem you should never be facing in the first place.

    And the default procedure to create a Multisite with sub-directories simply fails in local. At least for me.

    See so THAT is actually the problem here :) Fail how?

  5. Carlo Rizzante
    Posted 11 months ago #

    Ok, so help me getting it.

    I'm developing a WordPress Multisite with sub-directories (that it has to be online soon), and in order to work on it I would like to replicate the structure on my local machine.

    How would you proceed? What kind of solution would you have in local to develop a WPMU with sub-directories? And how would you later convert one in an other?

  6. I ... install locally. Seriously, I do this all the time.

    1) Install MAMP
    2) edit my hosts file to be able to use myrealdomain.loc
    3) Install WP
    4) Activate Multisite with Subfolders
    5) Beer.

    But see you said that wasn't working. You did not say WHAT wasn't working :) I can't tell you how to fix something if I don't know what the actual problem is. Right now, you're telling the doctor "It hurts!" and not "My leg hurts when I do this..."

  7. Carlo Rizzante
    Posted 11 months ago #

    Thanks for your patience, Ipstenu. I'll try to explain. Here what I do in order to setup my development environment in local.

    1. Install MAMP, Apache port :80, MySQL port :3306
    2. Create a folder "Development" inside the folder "Dropbox"
    3. Inside "Development" I create few sub folders:
    -- conf
    -- db
    -- vhosts
    4.a. "conf" contains the file I paste below, that setups few virtual servers.
    4.b. "db" is linked (symlink) with "Applications/MAMP/db".
    4.c. "vhosts" contains the virtual servers.
    5. I open the Terminal, digit "sudo pico /etc/hosts" and setup few locahosts (see below).
    6. I create a folder "sandbox.dev" into "vhosts" and I copy into it WordPress (v3.6).
    7. I follow the standard procedure for setting up a WP Multisite (sub-domains or sub-folders).

    // Details

    4.a. Configuring MAMP for virtual hosting (example for sandbox.dev):

    <virtualHost *:80>
    	ServerName sandbox.dev
    	ServerAlias sandbox.dev *.sandbox.dev
    	DocumentRoot "/Users/carlorizzante/Dropbox/Development/vhosts/sandbox.dev/"
    	<directory "/Users/carlorizzante/Dropbox/Development/vhosts/sandbox.dev/">
    		Options Indexes FollowSymLinks Includes
    		AllowOverride All
    		Order allow,deny
    		Allow from all
    	CustomLog "/Users/carlorizzante/Dropbox/Development/logs/sandbox.dev-access.log" common
    	ErrorLog "/Users/carlorizzante/Dropbox/Development/logs/sandbox.dev-errors.log"

    5. Terminal, localhosts:

    # ## Sandbox WP Multisite sandbox.dev *.sandbox.dev
    ## END

    As a note, sandbox.dev is one of the virtual host I've setup. Also, I am aware of the difference between a multisite with sub-domains and sub-directories. In production I have no problem, it is only in local that WP Multisite works with sub-domains, but not with sub-directories, and at this point I am lost.

  8. Steps 2, 3, and 4 I've NEVER had to do.

    That's why I'm at a loss here. I'm going to move this to Localhost in case someone there has an idea.

  9. Carlo Rizzante
    Posted 11 months ago #

    Thanks, Ipstenu. I did appreciate your support, and let's see if there is a solution to my trouble :)
    Best, Ciao!

  10. Carlo Rizzante
    Posted 10 months ago #

    Hello again,
    I just would like to add more details.

    Today I started from scratch, cleaning database and starting from WordPress 3.5.1, and I enabled WP Multisite with Sub-directories, and it all went smooth.

    Previously I was using WordPress 3.6, and I could not manage to have a Multisite working properly (as you can read above).

    When I opened the thread I could not activate WP Multisite with sub-directories, and I did not realize that also WP Multisite with sub-domains failed as well - all the Multisite I was managing at the time have been activated before the release of WordPress 3.6.

    So, I suspect that there is something not quite optimal with the way WordPress 3.6 manages Multisite. Unfortunately, admittedly my competence in this field are poor.


You must log in to post.

About this Topic