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.
- Find the lines in your hosts file that coincide with your multisite. Example:
127.0.0.1 example.local
127.0.0.1 www.example.local
::1 example.local
::1 www.example.local
- Add each subdomain beneath the multisite lines like:
127.0.0.1 example.local
127.0.0.1 www.example.local
127.0.0.1 subdomain.example.local
::1 example.local
::1 www.example.local
::1 subdomain.example.local
- 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.](https://kinsta.com/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2022%2F06%2Fdevkinsta-subdomain-multisite-browser.png&w=3840&q=75)