K
K
Konstantin Lavrovsky2020-04-26 01:46:15
MySQL
Konstantin Lavrovsky, 2020-04-26 01:46:15

How to create two sites on the same database?

Good afternoon, two WordPress sites, the content is the same, but the domains are different.
I was able to connect two sites to the same database, even to the same tables, but only if we go to the same address, for example, sity.ru, then everything is fine (it was created first and accordingly recorded in wp_options )
And if we want to switch to sity. com he will transfer us again to city.ru
Is there a way to solve it?
Or is it better to do different prefixes and when adding, duplicate information in different tables?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Orkhan Hasanli, 2020-04-26
@azerphoenix

The easiest option for you is WordPress MultiSite.
Turn on the multisite mode and you can create as many sites as you like. One database. some tables will be generic and some tables will differ in prefixes for different sites.
https://wp-kama.ru/handbook/wordpress/ustanovka-mu...

B
BasiC2k, 2020-04-26
@BasiC2k

It is unlikely that you will be able to fully use one database for two sites. The developers did not provide for this, and accordingly the links will not be correct for you (not everywhere). It is also likely that users will have incorrect cookies, because. they are bound to the domain. From an SEO point of view, this is also not very good ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question