Which plugin should I use, multi-domain or domain-mapping?

I would like to achieve the following:

WP Multisite is installed at blogs.domain.co.uk

I require blogsite1.domain.co.uk to become the URL for the site at blogs.domain.co.uk/blogsite1

Which plugin (multi-domain or domain-mapping) do I require to achieve this?

  • Jack Kitterhing

    Hi there @Rupert,

    Hope you're well today and thanks for your question.

    I don't believe Multi-Domains would work for this, as that's used for allowing your users to create a site at another domain such as domain1.com or domain2.com/

    Domain Mapping may work, though it's normally used for top level domains, but you're not looking to map a top level domain, correct?

    Thanks!

    Kind Regards
    Jack.

  • Rupert

    Hello Jack, thank you for your reply.

    Our wp multi-site setup uses a sub-directory approach for example:

    blogs.domain.co.uk/blogsite1
    blogs.domain.co.uk/blogsite2

    This has worked absolutely perfectly for our institute until a recent, additional requirement has meant we require one of the sub-directories to have its own sub-domain:

    blogsite1.domain.co.uk (which should point to blogs.domain.co.uk/blogsite1)

    I am not sure what you mean by top level domain in this context?

    Thank you for your time.

  • Hoang Ngo

    Hi Rupert

    About your sitation now,firstly, you will need to open the wp-config.php and replace this line
    define('SUBDOMAIN_INSTALL', true);
    to
    define('SUBDOMAIN_INSTALL', false);

    This will make all of the new site will be in subfolder way.

    And next,we need to update the .htaccess.
    Please backup your old .htaccess and use this instead

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Finally,go to the sites manager of wpmultisite,chose the old site and click edit.
    From there please update your domain and path to match your new subfolder way.
    Example
    Old one : a.domain.com
    So the domain in the edit should be "domain.com"
    and the path should be /a

    Please remember to check the "Update siteurl and home as well" checkbox.

    Update the url struct of many sites at once is not safe and can cause some bugs out of control,so i strongly recommend please do that on your staging network first before apply to the live site or atleast,have a backup

    Best Regads
    Hoang

  • Timothy Bowers

    Hey Rupert.

    I think we're misreading your question here. Let me start again.

    I’m reading this as you have a website:

    blogs.domain.co.uk

    This is a sub folder installation that was installed on a sub domain.

    So sub sites appear as:

    blogs.domain.co.uk/site2
    blogs.domain.co.uk/site1

    You want to make it like:

    blogs.domain.co.uk/site2 = blogsite1.domain.co.uk
    blogs.domain.co.uk/site1 = blogsite1.domain.co.uk

    So, in this instance you would use Domain Mapping, then you set the CNAME for the sub domain to blogsite1.domain.co.uk (or relevant sub domain) so that it points to blogs.domain.co.uk/site1 (or relevant sub site)

    Is this not what you want?

    Take care.

  • Rupert

    Thank you and sorry for the confusion. I didn't actually install the multisite but as far as I can tell, it has been installed in the ROOT folder of our web server. When I open the ROOT folder I see the WordPress folder structure and files.

    We indeed have a domain registered as:

    blogs.domain.co.uk

    with a top level site and the WPMU site directory plugin installed.

    We have numerous sub-sites created as

    blogs.domain.co.uk/blogsite1
    blogs.domain.co.uk/blogsite2
    blogs.domain.co.uk/blogsite3 etc

    We now have the requirement to use a specific sub-directory domain name of:

    newsubdirectory.domain.co.uk

    which has to resolve to one of the sites at blogs.domain.co.uk; for arguments sake

    blogs.domain.co.uk/blogsite2

    Should we be using Domain Mapping, Multi-domain or the htaccess file tweaks mentioned above?

    Many thanks

  • Timothy Bowers

    Hey again.

    No, it's not a charity... Ohh ok then you twisted my arm.

    What I've actually done is rather swapping plugins I've just upgraded your account to Gold. You have full access to all of our plugins and themes until your next renewal.

    Hope you get a chance to download a few and have a good play with them. Maybe there is something else you'd like

    Have a great day!