‹ Return to How tos

Define the primary domain for your WordPress Multisite instance in Amazon Lightsail

Last updated: November 18, 2018

A WordPress Multisite instance in Amazon Lightsail is designed to use multiple domains, or subdomains, for each blog site that you create within that instance. Because of this, you must define the primary domain to use for the main blog of your WordPress Multisite instance.

Prerequisites

Complete the following prerequisites in the order shown:

Define the primary domain for your WordPress Multisite instance

Complete these steps to ensure that your domain, such as example.com, redirects to the main blog of your WordPress Multisite instance.

  1. Sign in to the Lightsail console.

  2. On the Lightsail home page, choose the SSH quick connect icon for your WordPress Multisite instance.

    SSH quick connect on the Lightsail console.
  3. After your Lightsail browser-based SSH session is connected, enter the following command to change the directory to /opt/bitnami/apps/wordpress:

    cd /opt/bitnami/apps/wordpress
  4. Enter the following command to define the primary domain name for your WordPress Multisite instance. Be sure to replace <domain> with the correct domain name for your WordPress Multisite.

    sudo ./bnconfig --machine_hostname <domain>

    Example:

    sudo ./bnconfig --machine_hostname domains.com
  5. Enter the following command to keep the bnconfig tool from automatically running every time the server restarts. The bnconfig tool runs automatically every time the server starts to reset the machine hostname to its IP address. This is an undesirable action when using a custom domain name.

    sudo mv bnconfig bnconfig.disabled

    At this point, browsing to the domain that you defined should redirect you to the main blog of your WordPress Multisite instance.

Next steps

Complete the next steps after you have defined the primary domain for your WordPress Multisite instance: