Multisite Subdomain

To run a multisite in DevKinsta that uses subdomains for the subsites (subsite.example.local), a few adjustments will need to be made. These steps are not necessary if your multisite network uses subdirectories/subfolders (example.local/subsite).

This is also part of a workaround if you have a subdomain type of multisite with domain mapping. You will first need to deactivate your domain mapping plugin (if applicable) or change the mapped domains to subdomains (if your mapping is done with the domain mapping built into WordPress multisite). Then you can continue with the steps below.

Important notes:

  • This tutorial requires you to edit your hosts file, which is generally considered an intermediate to advanced topic. We have a guide here with instructions for Windows and Mac: How to Edit Your Hosts File – Preview Site Before Updating DNS 2. If you’re not comfortable making these changes or have any trouble after making changes to your hosts file, we recommend working with a developer or IT professional to set this up.
  • Each time you add a new subsite, you’ll need to repeat the steps outlined here.
  • These steps will need to be done whether you start a new subdomain multisite or import an existing site from Kinsta.

Edit Your hosts File

Note: If you haven’t already, add your new subsite(s) in your WordPress dashboard, then edit your hosts file as described below.

  1. Find the lines in your hosts file that coincide with your multisite. Example: example.local www.example.local
    ::1 example.local
    ::1 www.example.local
  2. Add each subdomain beneath the multisite lines like: example.local www.example.local subdomain.example.local
    ::1 example.local
    ::1 www.example.local
    ::1 subdomain.example.local
  3. After adding your subdomain(s), save your changes to your hosts file.

You should now be able to visit your subsite on your local site.

Viewing a DevKinsta subdomain multisite in the browser.
Viewing a DevKinsta subdomain multisite in the browser.
Was this article helpful?