"Visit Site" links to wrong site on multisite with domain mapping

I have a multisite set up using domain mapping on 1 sub site. The mapping works great, but now our "Visit Site" links in the dashboard and admin bar click to the wrong site. There is no pattern and it seems very random, and not on all of them. Basically when you're on 1 subsite and go up to the admin bar > subsite > visit site it takes you to the root site. And on our mapped domain "visit site" for said subdomain takes you to the site you are currently on.

They are just all jumbled. Any ideas?

  • Ash
    • WordPress Hacker

    Hello @Lindsay

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Are you using any caching plugin? Or even you have any cache in your server like varnish? If yes, please delete and disable cache and check again.

    If it still doesn't work, would you please run a plugin conflict test? Please deactivate all plugins except this one and check if you still face the problem. If not, then enable one by one and check which one is causing the problem. You can see the flowchart here: https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Please let me know what you get.

    Cheers
    Ash

    • wp.network
      • The Bug Hunter

      @Lindsay

      I have encountered some similar behaviors on various network projects depending on the Domain Mapping settings/configuration used...

      Can you post screenshots showing your settings at network>settings>domain mapping as well as a screenshot of the mapped domains tab at that same location, a screenshot of a subsite's Domain Mapping page (admin>tools>domain mapping) would also be good to see... this will likely help WPMUdev Staff diagnose your issue a bit faster... also, knowing the domain names in question and your IP address means some of your setup can be easily tested remotely (eg. whatsmydns.net) for common issues...

      Hope this can be helpful :slight_smile:

      Cheers, Max

      Edit: just noticed what looks like another of your threads with screenshots and such... if nothing has changed, I'll just go look at those :slight_smile:

      https://premium.wpmudev.org/forums/topic/cant-get-domain-mapping-working-1

  • wp.network
    • The Bug Hunter

    Hi @Lindsay

    Ok, well, looking at the other thread and your info above...

    I firstly want to make absolutely sure that you've been totally clearing your browser cache (and even flushing your computer's local DNS cache) in between settings changes while testing this stuff... you're doing that, right!?

    Though I don't remember exactly what configurations/conditions have caused me similar behaviors (I'm always discovering that I should be taking better notes!), I have the dubious pleasure of telling you that there is nothing that seems obviously misconfigured to me... which means that beyond potential issues with Domain Mapping, there may well be gnarly server stuff going on...)

    In particular, I noticed in your other thread @Michael Bissett posted

    After doing some further investigation here, it turns out that your server doesn't have the mbstring module enabled on it.

    Did you do your own server setup or did GoDaddy do it for you?

    Also, if you can answer a few Qs I may be able to offer an alternative approach to try...

    Subsite login/admin: do you want to use mapped address or original network address?

    Have you tried using the settings at network>settings>domain mapping to select 'mapped' or 'original' for login/admin of mapped domains? (your screenshot shows settings as: 'domain entered by the user')

    When you map the domain via admin>tools>domain mapping there is an options drop-down menu where you can select setting for frontend redirect (choosing 'disabled ...as entered by user' or 'mapped' or 'original' address for front end mapping)...

    I assume that your actual preference is to enforce domain mapping to achieve URL canonicalization (content at ONLY one address).... Once mapped it does not display the current setting, do you remember which setting did you use? Have you tested different settings here?

    And lastly, I assume you're running apache web server, is that right?
    If I can suggest some code that can be placed into an .htaccess file, is that something you can handle working with?

    Kind Regards, Max

  • Lindsay
    • Flash Drive

    Thanks for your help, I have enabled mbstring on our server, which help make out domain mapping actually work, so that was good. I have tried these suggestions and still nothing has changed. One thing I did notice is that oddly I do not have dropdown menu for options at admin>tools>domain. And yes, I can try some .htaccess code, I am comfortable with that.

    My main reason for using domain mapping is because the subsite needs to be at that specific URL, but we are using a global cart with our store.

  • Lindsay
    • Flash Drive

    I feel like it's a cookies issue because of another cart issue we are experiencing since activating the domain mapping:

    When I add an item on http://awcsilencers.com it does not show up on http://sacfirearms.com and vice versa. This also means that you can't checkout on any of the sub-sites that are mapped, because when you click Checkout it takes you to the main site with an empty cart.

    Everything was perfect until we did the mapping.

    (https://premium.wpmudev.org/forums/topic/cant-get-domain-mapping-working-1#post-808314)

  • Ash
    • WordPress Hacker

    Hello @Lindsay

    I have just logged in your site, and it seems only AWC site has a mapped domain? That site's 'visit site' link is working fine.

    Would you please add more details? Like which subsite and how I can reproduce? If needed, I will call the developer @Sam :slight_smile:

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Hello @Lindsay

    I have just logged in your site, and it seems only AWC site has a mapped domain? That site's 'visit site' link is working fine.

    Would you please add more details? Like which subsite and how I can reproduce? If needed, I will call the developer @Sam :slight_smile:

    Cheers
    Ash

  • Lindsay
    • Flash Drive

    @Ashok thanks so much for looking into things. We have solved the issue of the "visit link" but if you look above my issue now is that our items in the cart of the mapped domain (AWC) disappear when we go to checkout. (Cookies issue?)

    I started a new thread here https://premium.wpmudev.org/forums/topic/items-on-mapped-domain-disappearing-from-cart-on-multisite?replies=3#post-809750

    so maybe I should make this as resolved. Just need help on this last bit!

  • Ash
    • WordPress Hacker

    Hello @Lindsay

    I got it :slight_smile: I thought the cart issue is fixed but domain mapping still not working :slight_smile:

    Thanks for clearing, I am sending a note to Tyler so that he can take a look at the other thread as soon as possible :slight_smile:

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.