WordPress Multisite and Domain Mapping on shared IP using H-Sphere

Many hosting providers do not support wildcard DNS which is a very useful thing for WP Multisite as it allows your subdomain to automatically resolve. However, you can manually configure your shared hosting package and get it working without much difficulty. Once you have that working you can easily map a domain to your Multisite subsite. Most of the other posts I have seen on this topic reference CPanel but I’m using H-Sphere instead. (Assumes you already have the Multisite configured – see ‘Create a Network’ in the WordPress codex)

There are four steps required to setup a domain mapped to a WP Multisite subsite on a shared hosting account with a shared IP address.

  1. Create the subsite
  2. Get the web host to recognise your Subsite
  3. Steer your domain to your WP Multisite
  4. Use Domain Mapping to tie your domain to the subsite.

Step 1: Create The Subsite on WP MultiSite
Go to your Network Admin (or Super Admin for pre-WP3.1) area of your WP Multisite and add a new site.Example: setup a site called ‘test’. If you are using subdomains on your Multsite then this will be ‘test.mydomain.com’.

At this point you have created a site but your shared hosting plan does not know that ‘test.yourdomain.com’ is a valid address. If you try to view your site you will get a ‘Page Not Found’ type of error.

Step 2: Get Your Web Host to see your Subsite
Go to your hosting package and add a Server Alias to your main domain. In this case add ‘test’ as the server alias. Your hosting package will now know that test.yourdomain.com is tied to your main www.yourdomain.com. This can take a little time for the internal DNS to sort itself out – give it an hour or so (could be more depending on your hosting company). Tip: Do Not use H-Sphere to create the subdomain manually as that doesn’t work in this case - Multisite needs to resolve it so just steer it to the Multisite.

Eventually when you go to test.mydomain.com you will see the subsite you setup in your MultiSite. At this point your site is good to go – you only need the following steps if you want to map a domain to that new website.

Step 3: Steer Your Domain to your WP MultiSite.Before you attempt any domain mapping, you must first steer your domain to your MultiSite. If you intend to do this with a shared hosting package and use a shared IP address here’s how to do it. In this example, we will steer www.myotherdomain.com to our MultiSite and in Step 4 will map it to test.mydomain.com.

Go to your HSphere control panel and add ‘myotherdomain.com’ a Domain Alias to ‘mydomain.com’. If you get an error that there is already a DNS zone for this domain then delete myotherdomain.com from your HSphere and then try again to add it as a domain alias. (In order for this to work the domain MUST be using the same name servers as those used by the shared hosting with your Multisite. If it is not, you need to create additional DNS A records for the domain to point it to the IP address of your shared hosting package).

This can take several hours or longer to propagate so be patient.

You will know the change has taken effect when you click on www.myotherdomain.com and you are taken to the new registration page on your MultiSite. Your domain is steering correctly to MultiSite but you haven’t told WP yet where to send it to on your site network.

Step 4: Domain Maping.You now have a subsite that is working. You also have a domain that is resolving properly to your MultiSite network. Domain Mapping simply joins www.myotherdomain.com to the subsite ‘test.mydomain.com’.

Go to your Domain Mapping administration interface and add www.myotherdomain.com as a mapped domain for test.mydomain.com.

This solution is not really suitable where you want to have on-demand subsites created by your Multisite e.g. blog networks. If that is a requirement find a shared hosting provider that supports wildcard DNS or get yourself a dedicated IP on a VPS or cloud instance. However, if you want to manage a number of WP sites through a single dashboard and you don’t mind spending a few minutes on the config then you can get Multisite and Domain Mapping working on pretty much any shared hosting provider.

Comments

  1. pretty good insights. I’ll be sure to stop by and read more from you. thanks.