最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - How do I use different URLs in a single WordPress installation?

programmeradmin1浏览0评论

I will try to explain as clearly as I can because I know this topic is complicated.

I have 17 domains purchased in the same hosting. I want to use those domains with a single WordPress installation, that is; Each domain points to a different area of my company and for each area the web is the same, the only thing that changes is the content of it. It seems silly to have to clone my website 17 to have 17 WordPress installations. I know this can be done, but I don't know very well how.

Can someone help me? Thanks

P.D: Here is an example of the urls:

  • etc...

I will try to explain as clearly as I can because I know this topic is complicated.

I have 17 domains purchased in the same hosting. I want to use those domains with a single WordPress installation, that is; Each domain points to a different area of my company and for each area the web is the same, the only thing that changes is the content of it. It seems silly to have to clone my website 17 to have 17 WordPress installations. I know this can be done, but I don't know very well how.

Can someone help me? Thanks

P.D: Here is an example of the urls:

  • http://www.domain-1
  • http://www.domain-2
  • http://www.domain-3
  • http://www.domain-3
  • etc...
Share Improve this question edited Sep 13, 2019 at 13:16 Matthew Brown aka Lord Matt 1,0683 gold badges13 silver badges34 bronze badges asked Sep 13, 2019 at 9:32 Dario B.Dario B. 15510 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Prior to 4.5 vanilla WordPress (without any extras) could get you close but not all the way. As of WordPress 4.5, they no longer require a plugin to map domains. There is a plugin that can allow separate domains to be used in a single multi-site setup but I do not recall what it is at present. (besides plugin recommendations are outside of the scope of this site.)

You will need to look at a multi-site installation. Then you will need to take care of domain mapping. According to the documentation:

In the network admin dashboard, click on Sites to show the listing of all the subsites, and then click on edit for the subsite you want to map to. In our example, this is subsite1.mynetwork.

In the Site Address (URL) field, enter the full URL to the domain name you’re mapping – https://mappeddomain – and click save.

There exists the possibility of cookie problems (I'm just quoting the docs now as I have never done this). These can be fixed thusly:

If you get an error about cookies being blocked when you try to log in to your network subsite (or log in fails with no error message), open your wp-config.php file and add this line after the other code you added to create the network:

define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
发布评论

评论列表(0)

  1. 暂无评论