I currently have a multisite install with 4 sites and 4 domains, like so:
Site 1
-> site1
Site 2
-> site2
Site 3
-> site3
Site 4
-> site4
There was a typo in the domain of Site 3
, so we changed site3
to site3-new
. So far so good. Now we want site3-new
to show Site 3
, and we want site3
to show site3-new
.
That last step is causing me endless headache. What's happening right now is that visiting site3-new
opens up Site 3
, while visiting site3
opens Site 1
(it redirects 302 to site1
), presumably because in wp-config site1
is set as 'DOMAIN_CURRENT_SITE'
.
What can I do to show 1 site from the multisite instalation for 2 separate domains?
Thanks.
I currently have a multisite install with 4 sites and 4 domains, like so:
Site 1
-> site1
Site 2
-> site2
Site 3
-> site3
Site 4
-> site4
There was a typo in the domain of Site 3
, so we changed site3
to site3-new
. So far so good. Now we want site3-new
to show Site 3
, and we want site3
to show site3-new
.
That last step is causing me endless headache. What's happening right now is that visiting site3-new
opens up Site 3
, while visiting site3
opens Site 1
(it redirects 302 to site1
), presumably because in wp-config site1
is set as 'DOMAIN_CURRENT_SITE'
.
What can I do to show 1 site from the multisite instalation for 2 separate domains?
Thanks.
Share Improve this question asked Apr 25, 2017 at 8:47 VesterDeVesterDe 3463 silver badges13 bronze badges 2- Have you tried an .htaccess redirect? If you place it in the root folder of site3 and 301 redirect everything to site3-new that should do it. – WebElaine Commented Apr 25, 2017 at 15:29
- You need to show your wp-config.php custom settings. If you are using multiple domains, you cannot set DOMAIN_CURRENT_SITE to a static setting. – user42826 Commented Apr 25, 2017 at 17:14
2 Answers
Reset to default 2In vanilla WP, a site cannot serve multiple domains like that unless it's the root site.
Additionally, your desired setup would lead you to one of two situations:
- You're succesfully serving the site on 2 domains, but all the canonical tags point to the first domain regardless of which is setup
- Google sees duplicated content and hits both sites with an SEO penalty
Which leads us to the SEO friendly, simpler more performant solution:
Set up your Host to redirect site3
to site3-new
, and only serve WP from site3-new
. Any visitors to site3
would get a 301 redirect to site3-new
. This updates all the search engine results too.
You can do this via Nginx or HTAccess rules, but most hosts have a point and click option to do this in their hosting panels, even some DNS providers will do this for you.
Otherwise you would need to install a plugin for doman mapping. But this would be an inferior solution for your problem with various disadvantages.
I think the best way to have multiple domains on the same Multisite installation is to have a different network for each domain using https://wordpress/plugins/wp-multi-network/.
details of the wp-config.php setup is (including DOMAIN_CURRENT_SITE) is here https://github/stuttter/wp-multi-network#domainsub-domain-flexibility
But over all it depends on what interaction you want between the sites.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742306777a4419097.html
评论列表(0条)