301 redirects to primary domain

Hi,

Trying to replace the excellent plugin by Donncha called WordPress MU Domain Mapping, I find this one (Domain Mapping) a bit more restricted. Most worrying is the fact that even though I finaly figured out how to allow multiple domains to be mapped to the same site, I cannot find out how to make them 301 towards one mapped domain, selectable by the site admin among all his mapped domains. Just as the 'old' subdomain.networkdome.in redirects with a 301 to the first (?) mapped domain.

As it is now, each additional domain represents a perfect copy of the site which is said to be dangerous for SEO as it might be seen as duplicate content...

Am I missing something or is this not yet implemented?

Cheers,
Allard

  • RavanH

    Another worrying thing is that Domain Mapping seems to choose at random which of the multiple domains is going to be the 'primary' one, meaning the one that the original URL will redirect to.

    At closer look, it seems to be always the one at the top of the list of domains, which is not necessarily the first or last one entered. But rather based on alphabetical ordering, which puts it completely out of (super) admin's control :slight_frown:

  • aecnu

    Greetings Allard,

    Thank you for bringing this item to our attention.

    I find this one (Domain Mapping) a bit more restricted

    Absolutely because it must be able to integrate and function with provisioning done with our Pro Sites plugin in the creation of sites and automatic Domain Mapping provisioning.

    Most worrying is the fact that even though I finaly figured out how to allow multiple domains to be mapped to the same site, I cannot find out how to make them 301 towards one mapped domain

    With your idea in mind and wanting to offer a possible solution, I would make a sub site that is not part of the main site you want these domains to point to.

    Then of this sub site I would make a page static to the front end/home page and using the Quick Page/Post Redirect Plugin have it 301 redirect over to the main domain that I wanted - as you want.

    Am I missing something or is this not yet implemented?

    Unfortunately it is not natively implemented.

    And a third disappointment is that some site owners absolutely want a www in front of their domain name (I don't see the point but that's what they want) but Domain Mapping does not seem to allow that and strips that off.

    This is because once again integration with Pro Sites and in a MultiSite www is just another sub domain therefore it does not allow this natively. Of course if a person types in www it will indeed still resolve to the correct domain with or without.

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

  • RavanH

    Thanks for the response. I appreciate the fact that this has to work with Pro Sites (the reason why I try to switch to Domain Mapping) so I'll have to find my way around these issues and convince site owners that www is really old-fashioned :wink:

    One question: is support for multiple mapped domains with one to be set as the primary (by the site owner) and other domains 301-ing to it, on the road map by any chance?

  • RavanH

    Hi Joe, too bad the latest complete overhaul of Domain Mapping did not include the possibility to set a primary domain to which secondary domains are 301'd to. Still a major drawback of this plugin when compared to the famous alternative on WordPress Extend...

    Have plans in this respect been made clearer? I'd really appreciate this and so will search engines. Duplicate content all over our network because of the lack of 301 redirection :slight_frown:

  • RavanH

    Thanks PC, I'm looking out for any news on this front :slight_smile:

    It seems a bit silly to me -- specially when offering affiliate domain selling via enom! -- that site owners are only allowed 1 domain by default. And even with the DOMAINMAPPING_ALLOWMULTI constant activated, there is no real support for multiple domain management.

    Site owners wanting to secure an alldom (.com/.net/.biz etc.) and simply redirect them all to one domain of preference, are not uncommon. And as it is now, the plugin provides no control over which is the primary domain.

  • RavanH

    Fantastic! The 301s work perfectly :slight_smile:

    Feedback:

    First of all I must say I love the way this is implemented. The star icon to set a domain as primary I find very user-friendly.

    I did run into a minor 'bug'. When trying to deselect a domain that has been set as primary, I get a blank page...

    And some considerations on fine-tuning:

    1. The system now seems to pick one domain as primary domain (last one according to site owner input? I'm not sure) by default. I'm not against this but it might be less confusing if this would visibly reflect on the user domain mapping settings page by way of the filled icon next to this domain... Or even better: let Super Admin decide what should happen when no domain is selected as primary: either choose one (last, first or alphabetically?) by default or keep the old behaviour of no redirection. And then, to prevent a surprise to all super admins upon the next plugin upgrade, set this option to 'no redirection' by default :slight_smile:

    2. Clicking a star icon immediately changes the primary domain which might be too sensitive for some users that are not aware of what they are doing... maybe a little dialog upon clicking the star icon, warning users they are about to change the default domain (and to ask if they are sure) same as the delete icon?

    3. It seems possible to select a domain as primary that has an 'invalid' health status. It might be wise to not allow this to prevent users locking themselves out of their site...

    In any case, whatever you decide, this beta is going to my production server as it is right now!

    Many, many thanks :slight_smile:

  • RavanH

    Hi Eugene, testing the latest beta right now and indeed the default domain is now visibly set as primary. But suddenly I cannot change the primary domain anymore. Selecting another domain seems to 'take' but refreshing the domain settings page reveals the old default primary is still primary... And going to the front end reveals the same so it's not just the visual aspect of the setting :wink:

  • RavanH

    Some thoughts/issues:

    1. The dialog text "You are about to select domain as primary. Do you really want to proceed?" could be a bit clearer when changed to something like "You are about to change your primary domain. Do you really want to proceed?"

    2. On one site (use case) I noticed that the first domain, by default primary now, was an 'invalid' domain. This first domain is marked invalid because it intentionally has been pointed to another IP to provide a 301 redirect to a second domain from there. But now that this first domain (with the 301 redirect to the other domain) had been auto-selected as primary, the result is an infinite redirection loop for visitors, which meant the site was inaccessible.

    To prevent this from happening to others upon the next upgrade, there is something more needed than that warning message on the options page dialog, I'm afraid...

    Seeing the system does not even allow users to add new domains before they become valid (why? it seems a bit drastic...) maybe it should not even be made possible to set an 'invalid' domain as primary? Specially not by default I mean.

  • Eugene Manuilov

    1. The dialog text "You are about to select domain as primary. Do you really want to proceed?" could be a bit clearer when changed to something like "You are about to change your primary domain. Do you really want to proceed?"

    Thanks! I have updated this message.

    What if there would NOT be any domain selected as primary by default?

    The first added domain will be used by default as primary. It will be the first top domain in your list.

    Seeing the system does not even allow users to add new domains before they become valid (why? it seems a bit drastic...)

    Check network options page. There is an option Verify domain availability which allows you to disable pre-map domain verification.

    it should not even be made possible to set an 'invalid' domain as primary?

    Currently health check works as notification in the plugin, which just says to an admin to look at that domain and check what is wrong with him. This health check information time to life is 7 days, after it the plugin tries to re-validate it next time when an admin visits the mapping page. All it means that the plugin can't rely on this information and works like all domains are valid. In other words the plugin relies on admins who have to know what they are doing and it is their responsibility to map only valid domains and fix invalid one.

    So to summarize said above, I don't see a way how I could implement protection from invalid domains in the plugin and the plugin relays responsibility on admins to control health status of their domains.

    P.S.: I have fixed one small bug in the plugin. Find new archive in attach.

    Regards,
    Eugene

  • RavanH

    Check network options page. There is an option Verify domain availability which allows you to disable pre-map domain verification.

    [EDITED] Oh right, I thought that option would completely switch off the domain verification feature. And as it is a very valuable feature which can prevent a lot of mistakes I never tried switching it 'off' like that. Now I see that it only relieves the blockage of adding an unverified domain prematurely and no longer shows the warning message. Ideally, I'd prefer a middle ground. Allowing site owners to add additional domains but do show a warning when it does not pass verification. Maybe only completely block adding the first domain without verification because that could have graver implications, specially if Super Admin has set the option "Administration mapping" to "mapped domain". Anyway, thanks for clearing this up for me. :slight_smile:

    ... I don't see a way how I could implement protection from invalid domains in the plugin and the plugin relays responsibility on admins to control health status of their domains.

    I see your point. That's why I suggested that it'd be best if by default the plugin would work 'as before'. I mean: not redirecting unless there is a domain explicitly set as primary...

    This would prevent unexpected results for cases like I described when this beta goes stable. I know there won't be many, but it is possible there are domains that point to other IPs or don't even exist anymore.

    Let's say a site owner has changed his domain name at some point. He bought a new one, added that in Domain Mapping and organized a redirect from the old domain to the new one and at some point he might even have let the old one expire. But... he did not delete it from the Domain Mapping settings because it 'just worked' and it never occurred to him that would have any consequence some day.

    In such a case, that old domain (which was entered first so it will be at the top of the list!) will suddenly become the primary domain effectively taking out the website either by an infinite redirection or not resolving to a registered domain. And let's imagine that site is out for a few hours or day or two until the site owner learns he missed a lot of leads and comes knocking at Super Admins door asking for compensation...

    That's kind of a nightmare upgrade for any Super Admin and I would not want this to happen to anyone -- caused by my feature request! :wink:

  • Eugene Manuilov

    Ok, your thoughts make sense :slight_smile:

    I have reworked front end mapping and now it works like this:

    • If only one domain is mapped, then front end redirecting is always enabled to this domain
    • If many domains are mapped and no one is selected, no redirection will be done for front end
    • If domain is selected as primary, then front end will be redirected to this domain

    Find the archive in attach and don't forget to clear browser cache :wink:

    Regards,
    Eugene

  • Eugene Manuilov

    Hi @RavanH

    Finally I have found a time to implement it properly. So right now it works like this:

    • If DOMAINMAPPING_ALLOWMULTI constant is not set, then it works like before, nothing changed.
    • If DOMAINMAPPING_ALLOWMULTI constant is set and no primary domain is selected, then no redirect will be made, all domains are available.
    • If DOMAINMAPPING_ALLOWMULTI constant is set and primary domain is selected, then all mapped domains will be redirected to primary domain.

    Find updated version in attach and let me know if it works as expected or something has to be changed.

    Regards,
    Eugene

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.