Best 301 redirect method for Subdomains with Domain Mapping

Hi -

We have a mutli-site setup where we have domains first set like this: xyzcompany.ourTLD.com.

We are using the WPMUdev Domain Mapping plugin at times to later change the blog's subdomain to: blog.xyzcompany.com.

So, we are after the most efficient 301 redirect solution to affect this change and that will work with the Domain Mapping plugin.

I am aware of htaccess, php function, and plugin solutions and have read a bit about these here on the forums, but need to know best recommendation for the above configurations with Domain Mapping in place.

Thank!
- Scott

  • socialtract
    • New Recruit

    Hi -

    I know that Domain Mapping, by its nature does a redirect, but does anyone know if Google trusts this as they do for a 301 redirect, and so the accrued SEO ranking values will transfer?

    We have a mutli-site setup where we have domains first set like this: xyzcompany.ourTLD.com.

    CLARIFICATION: Clients may stay with this for 1-5 months before switching via the domain mapping to a subdomain of their own website. During this time period, they gather "SEO juice" for this initial subdomain and when updated via domain mapping (see below), we need a best method/plugin to redirect from the old subdomain to the new.

    We are using the WPMUdev Domain Mapping plugin at times to later change the blog's subdomain to: blog.xyzcompany.com.

    So, we are after the most efficient 301 redirect solution to affect this change and that will work with the Domain Mapping plugin.

    CLARIFICATION: If a client's site was listed as xyzcompany.ourTLD.com, and changes to blog.xyzcompany.com (after 2-5 months) -- does the Domain Mapping plugin handle all 301 Redirects in such a way that Google transfers accrued "SEO Juice" (ranking) to the newly mapped subdomain?

    I am aware of htaccess, php function, and plugin solutions and have read a bit about these here on the forums, but need to know best recommendation for the above configurations with Domain Mapping in place.

    Thanks -
    Scott

  • socialtract
    • New Recruit

    Hello Chris & "Uniimi" -

    Good to know your "SEO juice" transfered over, Chris and I know about WebMaster Tools, so we will use that method. Any idea of there were still any 404, page not found errors? Probably, the mapping takes care of this.

    Uniimi -- thanks for suggesting the Redirection plugin... I am aware of it for regular WordPress sites, but it does not state that it works on multi-site blogs. Anyone else using it with no problems?

    Regards -
    Scott

  • Tracy
    • The Incredible Code Injector

    If you move from blog1.tld.com to blog2.tld.com, there is no domain mapping involved, you will need to manually setup redirects via .htaccess. If you are moving from blog1.tld.com to newmappeddomain.com, the wpmudev.org domain mapping plugin is supposed to enable a 301 redirect, but it is broken and does a 302 temporary redirect, which is not what Google or most SEO's tell you to do to maximize passing google juice to the new domain. WPMUDEV is aware of and came up with a solution over a year ago but has never implemented it. https://premium.wpmudev.org/forums/topic/domain-mapping-plugin-302-redirect-issue-from-7-months-ago-still-occurring

    Once you fix the domain mapping plugin, you can use this site to put in the unmapped domain blog1.tld.com to confirm it is 301 redirecting: http://www.webconfs.com/http-header-check.php

    You will need to change the following to fix it:

    Replace lines 624 through 626 with:

    Header( "Location: " . $url . $request, true, 301);
    			} else {
    				Header( "Location: " . $url . $_SERVER[ 'REQUEST_URI' ], true, 301 );
  • socialtract
    • New Recruit

    Excellent answer, Tracy -- I sent you 25 points.

    Now the question is... why has WPMU-dev not updated this essential fix?

    NOTE TO WPMU-dev -- Please upgrade the Domain Mapping Plugin accordingly, ASAP, and post reply here (other members... you may second the request here, if you like).

  • socialtract
    • New Recruit

    Hello -

    Checking in my current Domain Mapping code, on lines 619 - 621 (slightly different than Tracys') I see the following:

    Header( "Location: " . $url . $request,  301);
    			} else {
    				Header( "Location: " . $url . $_SERVER[ 'REQUEST_URI' ], 301 );

    Comparing that to the code that Tracy posted above, I see only the parameter "true," missing on the first and last line. Is this the correct change needed?

    Note that I did check my headers and the WPMU-dev Domain Mapping plugin is still throwing 302 redirection out, and IS NOT GOOD FOR SEO... so we DO need a fix.

    Thanks-
    Scott

  • UNIIMI
    • The Incredible Code Injector

    socialtract,

    Just took a closer read through the documentation for Redirection and t does say "it is only possible to redirect a URL that exists on your website (you cannot redirect an external website, for example)."

    Sorry I couldn't help.

  • James Farmer
    • CEO (of WPMU DEV, honest)

    Hi Socialtract,

    As we haven't heard back from you we're going to assume the problem was sorted out and mark this thread as resolved.

    If it wasn't resolved, or you have any more questions related to this thread please feel free to post them below and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, thanks for using the forums, and, as always, for being a member of WPMU DEV, it's a pleasure to help you out and we look forward to being of assistance in the future.

    Cheers, James

  • Sean
    • Design Lord, Child of Thor

    I use the domain mapping plugin. My problem is that I need to redirect some old pages on the mapped domain. So, xyz.com/old.htm needs to go to xyz.com/new. How can I do that while the actual domain where the multisite is installed is multisitedomain.com? In other words, domain maping from xyz.multisitedomain.com to xyz.com is resolved via the plugin. How does the regular page redirects within the mapped domain are resolved?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.