WordPress.org

Support

Support » Plugins and Hacks » WordPress MU Domain Mapping » [Plugin: WordPress MU Domain Mapping] How to have two URLs for the parent site?

[Plugin: WordPress MU Domain Mapping] How to have two URLs for the parent site?

  • We’re setting up a new network of sites. The owner of the network wants to have both ‘example.com’ and ‘example.co.uk’ going to the parent domain.

    WordPress Multisite has been installed in example.com as a subdomain install and this plug-in has been installed and configured.

    The domain mapping plug-in does not allow domains to be mapped to site 1, so it’s not possible to add ‘example.co.uk’ as being mapped to site ID 1.

    Is there any way to get example.co.uk to map to example.com when example.com is the parent of a multisite network?

    From reading these forums the answer seems to be either ‘no’ or to use “define( ‘NOBLOGREDIRECT’, ‘http://www.example.co.uk’ );” in wp-config.php – which we could not get to work. Maybe we missed a step.

    Is there something clever we can do with setting redirects in cpanel, editing zone files, or perhaps something else entirely we can do to achieve this?

    It seems very typical for an organisation to want a parent site that has a couple of top-level domains pointing to the same place. I look foward to finding out just how easy it is when you know how.

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ron Rennick

    @wpmuguru

    Domain Mapping cannot be used to map a second domain to the main site.

    Thanks Ron.

    Is there nothing that can be done with DNS, .htaccess or some other work-around in either the server configuration or the code?

    The requirement to have a couple of alternative tlds for a parent site does not seem too unusual. I’ll put in a feature request.

    Plugin Author Ron Rennick

    @wpmuguru

    The requirement to have a couple of alternative tlds for a parent site

    You can have both domains going to the parent site using a redirect. That’s relatively easy to do and quite common.

    From a search ranking perspective you would not want to have an entire site appearing on two separate domains making the two domains appear identical to the search engines.

    Maybe you have set it up in the meanwhile, but just for future reference, this is how I did it:

    I’ve put the following code in my .htaccess below the RewriteEngine On statement:

    #Redirect secondary domain
    RewriteCond %{HTTP_HOST} ^www.domain2.com$[OR]
    RewriteCond %{HTTP_HOST} ^domain2.com$
    RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]

    Don’t know if this is the best way in terms of SEO though.

    I too am having this problem I have 3 tld’s that all have .com.au’s and .com extensions and want to map all the .com’s to the .com.au’s

    I’ve been trying for a few days now different methods but nothing works 100%

    As helpfulwebhosting mentions there are a lot of companies that would have more than a single domain name extension i.e. .com, .co.uk, .com.au that will/would want to have them all pointing at the same site. Fingers crossed we can get a patch or fix for this. Soon.

    Plugin Author Ron Rennick

    @wpmuguru

    would have more than a single domain name extension i.e. .com, .co.uk, .com.au that will/would want to have them all pointing at the same site

    It’s only the main site in the network that cannot be domain mapped. You can have multiple domains mapped to a subsite.

    Hi Ron,
    the main site in the network is clixbits.com so I’m not trying to map to it.

    The sites I have are all subsites, and have all been mapped with no problems.

    However I’m still getting bad results with redirecting.
    I have added the following the the htaccess file:

    RewriteCond %{HTTP_HOST} ^sydneycarmarket\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.sydneycarmarket\.com$
    RewriteRule ^/?$ "http\:\/\/sydneycarmarket\.com\.au\/" [R=301,L]

    here is the strange thing, it will redirect as you would expect if you enter http://www.sydneycarmarket.com to sydneycarmarket.com.au but it doesn’t redirect if you just enter sydneycarmarket.com

    I don’t know if it can be done or is possible using htaccess but it seems to me that if it’s possible to first change the non www address websitename.com to a http://www.websitename.com and then redirect to websitename.com.au

    I’ve googled but can’t find anything that relates to that problem.

    No need to use .htaccess for that. You can do all this from the WP admin area by mapping multiple domains to the same subsite.

    Just add the domain you want to redirect to as primary domain (either with or without www), so for example http://www.sydneycarmarket.com.au.

    Now add all the others (both the www and non-www versions) as secondary domains (just don’t check the primary box).

    Now your domain mapping list should look something like this:

    www.sydneycarmarket.com.au -> primary
    sydneycarmarket.com.au
    www.sydneycarmarket.com
    sydneycarmarket.com
    sydneycarmarket.clixbits.com

    In this case, everything will redirect to http://www.sydneycarmarket.com.au.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WordPress MU Domain Mapping] How to have two URLs for the parent site?’ is closed to new replies.
Skip to toolbar