$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'); ?>plugins - How to install WordPress Multisite with different domains under the same subdirectory?|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)

plugins - How to install WordPress Multisite with different domains under the same subdirectory?

matteradmin9PV0评论

Currently I have a WordPress blog with one domain as following:

All WordPress files are under blog directory.

Now I want to create another site using WordPress Multisites feature.

The second site will be as following:

Both domains are pointing to the same root directory therefore both domains have access to the same blog directory.

I have tried to use this plugin WordPress MU Domain Mapping it didn't work because current installation of WordPress is under /blog/

Here is the warning I'm getting:

Warning! This plugin will only work if WordPress is installed in the root directory of your webserver. It is currently installed in ’/blog/’.

Does anyone have any other suggestions?

Thank you.

Currently I have a WordPress blog with one domain as following:

http://example/blog

All WordPress files are under blog directory.

Now I want to create another site using WordPress Multisites feature.

The second site will be as following:

http://example-2/blog

Both domains are pointing to the same root directory therefore both domains have access to the same blog directory.

I have tried to use this plugin WordPress MU Domain Mapping it didn't work because current installation of WordPress is under /blog/

Here is the warning I'm getting:

Warning! This plugin will only work if WordPress is installed in the root directory of your webserver. It is currently installed in ’/blog/’.

Does anyone have any other suggestions?

Thank you.

Share Improve this question edited Nov 10, 2018 at 8:48 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 9, 2018 at 22:20 Aboodred1Aboodred1 1234 bronze badges 2
  • Possible duplicate of Wordpress multisite with different domain – butlerblog Commented Nov 10, 2018 at 4:54
  • @butlerblog my question kind different than the one you mentioned. I'm targeting a different domain on same sub folder. – Aboodred1 Commented Nov 12, 2018 at 17:10
Add a comment  | 

1 Answer 1

Reset to default 4

You don't need domain mapping in current versions of WP, it's built in.

You just need to edit the site Settings (under Network Admin, Sites, click on site then Edit). Enter the URL for the site (https://www.example or whatever). If you need to, use the Settings tab when editing the site and change all references to the correct domain name.

See also my answer here: Wordpress multisite with different domain

Added (by request)

When creating a multisite sub-site that will have it's own domain, I always create the site first. On the Network Admin, Sites, Add Sites screen, the URL will be https://www.example/subsite3 , where you enter 'subsite3' as the 'site address (URL)'.

Once you have set up the site (and registered the domain name, and set the domain's nameservers as required), then you can go into the Site Settings (Network Admin, Sites, edit the site) and change the URL on the Edit Site, Info tab to the actual domain name (https://www.newsite ).

I also go into the Settings tab on that screen and change the "SiteUrl" and "Home" settings if needed. And since some plugins may have your site URL (the original value you entered when creating the site), I always go through all the settings and change any URLs as needed in there.

Then, a test of all site pages (admin and actual site) to make sure they work correctly. I then configure plugins on the site as needed, then go back into the Settings tab (on the Network Admin, Site, edit screen) and make sure the new domain value is in all of the settings location.

Since WP 4.9x supports domain mapping (since 4.5?), there is no need for domain mapping plugins.

Post a comment

comment list (0)

  1. No comments so far