Make WordPress Accessible From Multiple Domains

You can make your WordPress website accessible from multiple domains (domain.com, ex.domain.com, anotherdomain.com) by doing the following.

Open up the panel’s file manager and go to the public directory (public_html on cPanel, httpdocs on Plesk).

Find your WordPress install. If the install is on the root domain (site.com) you’ll see lots of files named wp-something.php already. Otherwise, navigate to the folder where WordPress is installed and find these wp-something.php files.

Find the one named “wp-config.php” and edit that file. Add the following lines to the very bottom of the file, just before the “require_once ABSPATH . 'wp-settings.php';” line.

If you access your website over http:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

If you access your website over https (recommended):

define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);

Save the file. You’ll be able to access the website from any domain you connect to the site itself (after you configure that domain).