Multisite configuration issues

Hi there, I'm getting a weird issue on my multisite that I've been struggling with for a while. When I type in the url of my site without 'www', it gets re-directed to: http://www.domain.net/wp-signup.php?new=domain.net (note the no https). I have https enabled for all my subdomains and mapped domains.

I've seen some similar issues on here but never any clear solutions. I've done all the de-activate plugins, themes process, cleared caches, etc. so please don't recommend that lol.

I have the standard network setup rules in my htaccess file. Any help would be much appreciated. Thank you.

  • Adam Czajczyk
    • Support Gorilla

    Hi Tyler

    I hope you're well today and thank you for your question!

    Is this a sub-domain or sub-folder Multisite setup? The sub-domain one would be a configuration with sub-sites like "site1.domain.com", "site2.domain.com" and so on while sub-folder would have sub-sites like "domain.com/site1", "domain.com/site2" and similar.

    I also noticed that your site is behind CloudFlare. Could you please temporarily pause it so we could check "generic" DNS configuration and see if without CloudFlare the same issue happens?

    To disable it temporarily, please access your CloudFlare dashboard and in the "Overview" tab look for "Pause CloudFlare" option (it's a blue(ish) link) near the bottom of the left column there.

    Once it's disabled, please also enable support access to the site so I could check it. To enable support access, go to the "Network Admin -> WPMU DEV -> Support -> Support Access" page in your site's back-end and click on "Grant support access" button there.

    Let me know here, please, once this is all done as I won't be notified automatically.

    I'll then check DNS and site configuration and look for the possible cause of that issue and how to fix it.

    Best regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hello Tyler

    Thank you for your response and enabling support access.

    I checked the site and noticed that the main site is actually set to use "www" in it's main domain name. Technically speaking, the "www" is "like" a sub-domain so the "non-www" version simply doesn't exist, thus WP is "trying" to make you register it.

    Since the registration is currently disabled, you could try using NOBLOGREDIRECT define in wp-config.php file like this:

    define( 'NOBLOGREDIRECT', 'https://www.yourdomain.net' );

    where http://www.yourdomain.net should be replaced with your real domain (including www as it's set as the main address of the main site).

    I would, however, suggest trying a different solution. In case of sub-domain multisite it's never advised to use "www' prefix so instead:

    - make sure that in DNS there's "www" for your domain set as CNAME (I suppose it's already set that way but make sure about it)
    - in wp-config.php remove the "www" prefix from the

    define( 'DOMAIN_CURRENT_SITE', 'www.yourdomain.net' );

    so it would be just

    define( 'DOMAIN_CURRENT_SITE', 'yourdomain.net' );

    Then make sure that all the URLs in database are updated. For this, you can use e.g. Better Search Replace plugin

    https://wordpress.org/plugins/better-search-replace/

    to replace all occurrences of

    https://www.yourdomain.net

    with

    https://yourdomain.net

    in the database. There's also a "dry run" option in the plugin that lets you see first what changes would be made without actually making them.

    With that kind of configuration and the "www" set as CNAME this redirect should be gone.

    Best regards,
    Adam

  • Tyler
    • Site Builder, Child of Zeus

    Hi there, that seems to have done it and everything looks like it's working as it should. Thank you for the help. For future reference, is there any way to have it show 'www' for the main blog and have things still working properly. I do get this request sometimes from people, so wondering if it's at all possible or should just refuse and say it's not.

    Thanks for any information and the help!

  • Adam Czajczyk
    • Support Gorilla

    Hi Tyler

    Thanks for your response!

    If you do need to have "www" for main blog on a sub-domain based install and want/need to have registration disabled at the same time then you'll need to use that NOBLOGREDIRECT option (as described in my previous post) . But that's "official" solution so it's fine to use it :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.