$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Wordpress multisite with different domain|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Wordpress multisite with different domain

matteradmin12PV0评论

I'm new in the WordPress world and I've created WordPress multi site. I want to set different domain for my child sites.

Lets say my main site is www.myMainSite and my child is www.mySonSite.

I already changed the site URL (In WordPress config) to the new domain (instead of the default sub-domain) but it seems that the link is broken. I know that I need to change some configuration in my server but I didn't mange to do so. I use c-panel.

So what do I need to to to link the new domain to my child site? Thanks in advance.

I'm new in the WordPress world and I've created WordPress multi site. I want to set different domain for my child sites.

Lets say my main site is www.myMainSite and my child is www.mySonSite.

I already changed the site URL (In WordPress config) to the new domain (instead of the default sub-domain) but it seems that the link is broken. I know that I need to change some configuration in my server but I didn't mange to do so. I use c-panel.

So what do I need to to to link the new domain to my child site? Thanks in advance.

Share Improve this question asked Oct 28, 2018 at 20:40 Gili YanivGili Yaniv 1112 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

I believe that you have to go to the Network Admin (the 'master' admin), then Sites, then mouse over the site you wish to change, select Edit. So the process is not done from the sub-site's Dashboard, but from the Network Admin dashboard.

You may need to go into the Settings tab on the edit page to change other URLs, depending on settings that plugins or themes have made. Just carefully change the https://www.example/subsite1 to https://www.customdomain as needed.

A good backup of the database is always a good idea before doing that.

Once you make the Settings changes, then you'll need to change the newdomain's Nameserver settings to point to the correct place. If you have hosting, then the Control Panel Add-on Domains is where you want to go (depending on the host). The host supporting place can assist you with this.

You shouldn't need to change the site URL in the WordPress config. You should be able to just tell the new site that its URL is mysonsite.

Here's how you would do it:

  1. Create a new site in your Multisite installation. If you're using subdomains, this would probably default to mysonsite.mymainsite; if you're using subfolders, it'd be mymainsite/mysonsite.
  2. Go to the new site's dashboard, mouse over the site's name in the admin bar at the top of the page, and select Edit Site.
  3. Change the Site Address (URL) to www.mysonsite, and save the changes.

Note: You'll need to make sure that your DNS entry for www.mysonsite points to the same IP address as www.mymainsite, and that your web server's config knows that mymainsite and mysonsite go to the same WordPress installation. (In Apache, for example, you might have something like this in your config file:

ServerName mymainsite
ServerAlias www.mymainsite
ServerAlias mysonsite
ServerAlias www.mysonsite

...but different web servers have different configuration syntaxes, and server config is beyond the scope of this site.)

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far