Show one site and hide the rest

On the Hub, for the same site, three domains are showing up. I would like to show only one and hide the .biz version of the site and the www.

  • Predrag Dubajic
    • Support

    Hi Chuck,

    I tried checking your setting but I’m afraid that the password is no longer working.

    Basically, what the problem is here is that all of your 3 domains are loading as is, they are not redirecting to one main domain that you want to show in the Hub.

    It would be best to get in touch with your hosting provider about this and ask them to setup the redirects and add-on domains so that all of them are pointing to only one domain and that should do the trick.

    Best regards,

    Predrag

  • Chuck
    • Flash Drive

    I expected a notification by email when you replied. It’s only now that I look specifically at support tickets that I have found your response.

    You’ve missed the point of my setup. I’m not using redirects and addon domains; instead these are domain aliases in cPanel. The goal, as previously stated, is to have each domain show properly in the address bar, pulling up the same site, while showing only the primary site in the hub.

    In order to achieve the first part of my goal, I added these lines to wp-config.php:

    /*

    * Handle multi domain into single instance of wordpress installation

    */

    define(‘WP_SITEURL’, ‘https://’ . $_SERVER);

    define(‘WP_HOME’, ‘https://’ . $_SERVER);

    So now we have two issues:

    1. How to tell search engines there is only one site and it’s not duplicate content

    2. How to get the Hub to display only the primary site.

    For the first, I think I need to set https://cwgservices.com as the canonical url; please advise if that is right and what I need to do.

    For the second, one possibility would be for the Hub to check if a url is the canonical url, and only show the site if so. Another idea would be to have a ‘hide this site’ option in the Hub. Another idea would be to add a ‘display as’ setting in the WPMU DEV plugin; if left blank it would work as is, but if filled in it would show the site in the hub only as that url.

    I’m sure this isn’t a unique situation. What happens in a multisite installation? Do all the subsites show separately? Or just the network admin?

    Please help.

  • Adam Czajczyk
    • Support Gorilla

    Hello Chuck

    I hope you’re well today and I’m sorry for the delayed answer.

    So now we have two issues:

    1. How to tell search engines there is only one site and it’s not duplicate content

    In theory – yes, the canonical URL should help here though I admit I’ve never tested in in such scenario. Usually it’s used for a bit different reason: to avoid “internal duplication”, meaning duplication of content within the same site – while using multiple different domains for the same site actually means (for most search engine crawlers)… three different sites.

    So, canonical URL *should* help here but to be perfectly honest, I can’t guarantee it will solve the issue. The expected and “bulletproof” solution would be to use 301 (or at least 302) redirects but that would, unfortunately, break the functionality that you need (domains would be redirected). But in that case, I don’t see other option than canonical URL, I’m afraid, so hopefully that will be enough. Additionally, you could try actually excluding additional domains from being indexed at all either via robots.txt file or even by denying access to search engine robots via the .htaccess file (for those additional domains only) – though they would not be listed in Google then and only one (the “main” one) would be.

    2. How to get the Hub to display only the primary site.

    Multisite is actually a different case and not really comparable. The WPMU DEV Dashboard plugin and, in consequence, The Hub takes the site URL from the settings that you are actually altering (via wp-config.php) to make Site URL/WP URL dynamic… Such setup is kind of a “trick” that’s not really a WP standard. In a standard single and multisite setups those will be always pointing to the single URL/domain – not multiple once. Even on multisite that’d be a case because WPMU DEV Dashboard plugin is not working on “per site” basis but “per network” via Network Admin (it would list only one site – entire multisite – in The Hub).

    In essence, the WPMU DEV Dashboard uses the “network_site_url()” core WP function to get site address (this function also “falls back” to “site_url()” function if the site’s not a multisite) and those constants (“define” lines) that you’re setting to use “dynamic” value in the “wp-config.php” file) are affecting what’s returned by this function. Whenever any connection is made to The Hub via API that might be updated (thus adding those additional domains to The Hub).

    However, there’s a built-in option that should help so give it a try please:

    1) set following line in the “wp-config.php” file (above the “/* That’s all, stop editing line */”:wink::

    define( 'WPMUDEV_HUB_SITE_URL', 'https://cwgservices.com' );

    note: update the URL to the one you want to use with The Hub if I used a wrong one above

    2) give The Hub some time to update or try to logout and login back the WPMU DEV Dashboard plugin to your account

    If that still doesn’t help, also try to remove those additional domains from The Hub manually; with that define line set they shouldn’t be coming back.

    Best regards,

    Adam

  • Damo
    • Site Builder, Child of Zeus

    Brilliant. I came here tonight with the same issue (multiple instances of the same site appearing) and the DEFINE statement resolves it.

    Is there a complete set of documentation available for The Hub somewhere?

    • Adam Czajczyk
      • Support Gorilla

      Hello Damo

      I’m glad to hear that the solution helped you!

      As for docs, you’ll find all the available docs (not only for The Hub) here:

      https://premium.wpmudev.org/docs/

      Please note though: there’s no such detailed guide for that kind of configuration “tricks” there yet. We’re constantly improving our docs and adding new information but also a new Hub is coming up soon and it’s going to be a bit different “under the hood” (technically) so more detailed docs would follow that up in future rather than now.

      However, if you got any questions, please don’t hesitate to start your own support tickets or ask on our support live chat and we’ll be more than happy to assist you.

      Best regards,

      Adam

  • Damo
    • Site Builder, Child of Zeus

    Thanks Adam. The technical stuff would be good to have knowledge of.

    There is one issue that has presented since I added this define value (WPMUDEV_HUB_SITE_URL). From The Hub the WP-Admin link no longer includes the URL, instead it tries to open http://wp-admin/admin-ajax.php?action=wdpsso_step1&redirect=http%3A%2F%2Fwp-admin%2F&nonce=a6284da6e5

  • Adam Czajczyk
    • Support Gorilla

    Hello Damo

    Thanks for reporting it!

    I did some tests on my end and it seems that it does break this URL indeed with Single Sign On enabled – there’s apparently some “glitch” there (it’s a very new feature though) related to it.

    With Single Sign On option disabled it should be fine, at least it is in my all tests (though please note: changes on The Hub end might sometimes be delayed a bit – in case you’d want to experiment with it).

    That’s a great catch and thank you for sharing it with us. I’ve already passed that to our developers as a bug so they’ll look into it to implement necessary fix with future releases (not sure if the fix must be in The Hub or in the WPMU DEV Dashboard plugin but they’ll find it out).

    Best regards,

    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hey Damo

    How are you today?

    I just got some clarification on this from our developers and I’d suggest trying another constant (define) in configuration:

    for regular single installs

    define( 'WPMUDEV_HUB_ADMIN_URL', 'https://domain.com/wp-admin/' );

    for multisites

    define( 'WPMUDEV_HUB_ADMIN_URL', 'https://domain.com/wp-admin/network/' );

    Could you give it a try please and let me know if it solves the “WP ADMIN” button link issue for you (please note – the change in The Hub might not be immediate, you might need to wait a while)?

    Best regards,

    Adam

  • Damo
    • Site Builder, Child of Zeus

    I just dropped by this thread (after spending time trying to find threads I’m in) and never received a notification about this.

    I’ll add it tomorrow and see if it works as expected ( I hope so )

    But there is something else about this site and it’s email notifications that just doesn’t work correctly. What are the addresses that wpmudev sends from. I’d like to get to the bottom of it so that I get emails to posts.

  • Damo
    • Site Builder, Child of Zeus

    Odd, I didn’t get a notice from your post Chuck.

    I can see from the notices that do come through that they are actually sent from no-reply@premium.wpmudev.org and using mailgun with bounce handling. It’s frustrating how some come in and others don’t. No sign of them in the mail logs so I have to assume they’re not being sent or lost upstream for some reason.

    Adam Czajczyk that define did the trick, thanks for the update.

    • Adam Czajczyk
      • Support Gorilla

      Hey Damo

      I’m glad to hear that the solution worked for you!

      As for notifications, you should get notifications
      – for the very first response to the new ticket (e.g. you create a ticket, or its created for you and staff responds for the first time)
      – and then if you actually subscribe to the thread or use “notify me by email” option
      – and also for all the threads that you actually subscribed to even if you don’t participate

      If you are getting some notifications but some don’t go through even if you think they should, we’d need to look into it – but that’d be best to be handled in separate ticket as it’s about something completely different than original issue reported here :slight_smile:

      Best regards,
      Adam

  • Chuck
    • Flash Drive

    Adam, I was going to mention that checkbox for Damo… in the past, anytime I didn’t get notifications it turned out to be one of two things:
    1. I forgot to check the box
    2. They were going to spam (I added a filter to make sure that never happened)

    Thanks

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.