• Resolved caorongjin

    (@caorongjin)


    Hi there,

    OK, like everybody else here, I am trying to setup a multi-site by domain (so, like https://www.primary.com and https://www.secondary.com). What I did was I setup the subdomain network settings with my .htaccess reading:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    and my wp-config.php reading:

    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true );
    define('SUBDOMAIN_INSTALL', true );
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'www.primary.com' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1 );
    define('BLOG_ID_CURRENT_SITE', 1 );

    Then I create the other site, setup my CNAME to accept https://www.secondary.com, and changed the site’s domain to https://www.secondary.com.

    Now, I can hit both sites without a problem. However, if I try logging via https://www.secondary.com/wp-login.php, I get redirected to the same login screen but with the URL https://www.secondary.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.secondary.com%2Fwp-admin%2F&reauth=1.

    I tried using the recommendations with the sunrise stuff too. But that didn’t seem to help at all.

    Any words of wisdom here?

    Thanks,
    Alex

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

    (@ipstenu)

    ?????? Advisor and Activist

    Did primary.com/secondary work BEFORE you mapped it?

    What plugin did you use to map it?

    Thread Starter caorongjin

    (@caorongjin)

    primary.com has always worked and continues to work today both as a public site and in logging in.

    secondary.com was never an independent site so, only after setting it to the same server as primary.com did I enable multisite functionality. After doing so, I have only ever been able to view it as a public site; I have never been able to log into it.

    I did not use any plugin to map them. I merely followed the instructions here:
    https://codex.www.ads-software.com/Create_A_Network

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Right, you have to make a SUB site for secondary. And then use a plugin.

    See, Creating a Network does NOT make it so multiple domains will work. It makes it so you can create subsites like primary.com/secondary (or secondary.primary.com). Which was why I asked if THAT was working before you mapped it ??

    Make a site called ‘secondary’ on your install.

    Install https://www.ads-software.com/extend/plugins/wordpress-mu-domain-mapping/

    THEN it should start to work.

    Thread Starter caorongjin

    (@caorongjin)

    So I just deleted that the site secondary.com. Then, I recreated it in Sites > Add New secondary.primary.com and, in my CPanel, add a * subdomain.

    Now, when I hit secondary.primary.com, I get a server not found error message. Of course, https://www.secondary.primary.com doesn’t work either. ;/

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    https://secondary.primary.com SHOULD work. And should redirect if you’re using the plugin I mentioned.

    If that is NOT working, we should look at that first. Is it a 404 error or something else?

    Thread Starter caorongjin

    (@caorongjin)

    Well, I didn’t have activate the MU Domain Mapping plugin, so went ahead and did that. I also added a mapping of secondary.com to id 5 (the site ID of secondary.primary.com). Going to secondary.com redirects me to secondary.primary.com and I get the same error as before. It’s not even a 404… it’s as though the server doesn’t exist.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Let me rephrase this, because you seem to be skipping steps.

    BEFORE you can map a domain to a site on your network, that site MUST be able to function on it’s own.

    Thus. If you are trying to map secondary.com to secondary.primary.com (or primary.com/secondary), then it is an absolute requirement that the site be running as unmapped first.

    Does that make sense?

    Right now, today, the unmapped site is not working . So you can fiddlefart around with mapping all you want, and it ain’t never gonna work till you fix the real problem.

    Stop with the mapping, your MultiSite Install isn’t working.

    Now. WHAT is the exact error you get on secondary.primary.com?

    Thread Starter caorongjin

    (@caorongjin)

    Yes, I’m aware of that. Originally, I had stated that secondary.primary.com did not work without the mapping plugin. Then you said:

    And should redirect if you’re using the plugin I mentioned.

    So, I enabled the plugin and tested that too… though wasn’t sure why that would make any difference. And it didn’t (of course).

    So, to go back. The unmapped site (secondary.primary.com) did not work. In other words, you get no 404 or any other error message… you simply got the browsers default “server not found” message.

    NOW… a day after I enabled all the subdomain stuff… it seems to work. So I guess the problem was I had to wait some time. Which I find weird because I thought that it would automatically take (since I didn’t think it was a DNS change).

    Thanks for the help. Sorry for the confusion. We are now happy with glee, both primary.com and secondary.com. ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah, DNS should take no more than a couple hours (4 is ‘normal’ if you’re like me and are pathologically incapable of remembering to set the TLL lower!) but really you were getting the cart in front of your horse ?? Always get the bacics working, THEN add things on.

    Thread Starter caorongjin

    (@caorongjin)

    Wait, is adding a *.primary.com subdomain a DNS change? I didn’t think so. If so… then yah, I was putting the cart in front of the horse!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Oh yes, it is. You’re telling DNS ‘I accept ANYTHING.domain.com’ and if you didn’t set it up that way out of the gate (most of the time you do by accident) then it has to propagate.

    On top of that, your server can take time. I think it takes like 15 min for my server to sync up and remember foo.domain.com is real. Or it did, the new version of cPanel is smarter.

    Thread Starter caorongjin

    (@caorongjin)

    I see. Good to know. ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘MultiSite Domain Not Logging In’ is closed to new replies.