Can I have two identical websites over two domains, ideally running from same Wordpress? - wordpress

Strange question. Basically I want to test out the success of two possible domain names, so I want to run a website duplicated over two domains. Is that possible?
So, for example, both WEBSITE1.com and WEBSITE2.com would have the exact same content coming from the same wordpress set up.
I know that a redirection is possible but that reverts to a different domain, which is not what i want.
Thanks!
Ben

WordPress includes the ability to create a network of sites by using the multisite feature. This article contains instructions for creating a multisite network.
check below this link for how to set up multidomain on WordPress
https://codex.wordpress.org/Create_A_Network

Why not? In wp-config.php add check for domain name and load different database credentials.
The problem will be when adding content.

Yes, you can: https://codex.wordpress.org/Installing_Multiple_Blogs#Single_Database
Ps. You will get duplicated content issue with Google if you index both sites in Google.

Related

How to use another domain for a specific url?

I'm building a WordPress website for a client and can't figure out what to do here. I'm using translatepress to make my website multilingual and the client wants to have another domain for different language. So the default domain is example.com but English version is example.com/en . Is it possible to add another domain which replaces example.com/en and is still functional by pressing all the links? So it's like example2.com points to example.com/en , but not as a url forwarding, but it replaces the whole example.com/en part completely. What are my options here? Thanks.
You can have different sites in a network on different domains. It is just on the other domain, not on both. Since WP stores internal links as absolute URLS, you need to create the sites on the correct domain from the start, or use wp-cli or similar to re-write existing links when you change.
I was about to recommend the plugin I have used, but see from https://wordpress.org/support/article/wordpress-multisite-domain-mapping/ that from 4.5 it's a WP native feature!
Note: i don't use translatepress but have different languages as different sites in a network. Since you talk about sub-domains I'm assuming you do something similar

How to run two sites with single domain on wordpress?

Sorry! I don't know that the question I am asking have a logic or not.
I am not able to figure out what to do. I am stuck up from yesterday.
Make a multi-site network or customize my wp theme.
So what do I mean.
I want my main website and my landing website to be on same domain but my landing page should be in with subdirectories.
for example:
My main website domain is something like this : mywebsitemain.com
and
My landing page website is as follows : mywebsitemain.com/landing-page
Conclusion
1. Single domain
2. Two websites
Is this is achieve able without using multisite or not. If yes or no then how.
There is two way.
1)Setup two wordpress
First is in the root directory("main wesite domain")
And second one steup on the ("landing-page") directory. and when steup the wordpress then you should make both the table prefix different.
2)Make wordpress network
Check url : https://codex.wordpress.org/Create_A_Network

Install wordpress on subdomains

I need some help with wordpress. I have got a wordpress on my main domain and I would like to use another wordpress on my subdomains with the same theme, plugins, blog pages and posts but different links in my blog posts. I want to know how I can change the links in my blog posts for the main domain and the subdomains?
Do I need to create a subdirectory folder and a different database name for each subdomain and do I also need to copy the wordpress files from the main domain to the subddirectories folder so I could be able to create the username and password for the subdomains and then login in the wordpress for each subdomain to change the links in the blog posts?
I want you to understand that I want to use the main domain and subdomains to use the same theme, same plugins, same blog posts and same pages but the links in the blog posts have to be different, because I am going to use different traffic sources on each subdomain to track for clicks and sales, example: my main domain will be use for google traffic, the blog subdomain is for facebook and the other subdomain is for easyhits4u. I can track the clicks and sales for google and other traffic sources because the links in the blog posts for the main domain and subdomains would not be the same.
If I use the same links in the blog posts for the main domain and the subdomains, I would not know how many clicks and sales I would get from each traffic source I use and I would not know where the clicks and sales are coming from. That is why I want to use it seperate so I can track it easy.
To go a little further about the comment of #Sysix :
As far as I know, Wordpress Multisite allow you to have one folder that hold all of your websites. Your websites url can be subdomains or subfolders based (but this one not need to have a real subfolder, it's only about the url)
subdomain.example.com
example.com/subdomain
At my last work, the php developper made a plugin or something that allow you to have different urls for each site of the network.
example.com
example2.com
etc.
(I'm gonna search some informations about it, if you are interested in)
Websites are handled with the database only, and if you take a look at the wordpress database after you have create a new site in the network, you will get new tables wp_posts, wp_meta etc. with a number after them that is related to the site id.
So i think that the best way for you is to make one website, create all the post, the pages, and when it's done, duplicate it in a new site in the network.
You can use the plugin in the link below to duplicate a site of your network.
https://fr.wordpress.org/plugins/multisite-clone-duplicator/
Just a warning : I know that this way it could works, but I also know there some conditions to make it works great. I can't remember exactly why but I seem to recall that you can't easily duplicate the main website of the Network. There was a workaround to do it but I don't remember exactly what was the issue, and how to resolved it.
I'm gonna search and test some stuff right now, so this answer is not definitive but it could get you on the way. I will edit it if i find or remember some important thing.
Sorry for this answer that is not really an answer, but in comment it was not possible to write all this ... Also if I said nonsense, please correct me, and I will edit the post as well.

Installing multiple different instances of wordpress on the same website

I currently have a website up and running that is my freelancing website. What I wanted to do was create a testing subdirectory on the website.
So for example my site would be:
website.com
I want the testing site to be: website.com/test
I need this test to be private and require a password to view, as well as be a different installation of wordpress so I can manipulate it without editing my main website. Is this possible? Currently I have created a test directory from the cPanel that requires a password but it just brings me to a 404 not found page.
I would also like to create more, public, instances that I can use as a portfolio until I get more real clients. So for example I would like to have my site be: website.com/themeOne
Is any of this possible, or am I out of luck? Please let me know I would greatly appreciate any help. Anything I found found online thus far has either not been relevant or has not worked.
You can achieve this by setting up a wordpress multisite installation. I currently use this to host all my clients.
Will work like this.. Main site is website.com
Depending on how long you have had that site set up will determine whether your multisite install will be a subdirectory or a subdomain. If you have had your main site for a while it will be subdomains. ie. xyz.website.com
You will have to set up a wild card subdomain on your server though...so keep that in mind.
Here is the documentation on setting up a wordpress multisite
https://premium.wpmudev.org/blog/ultimate-guide-multisite/
You can install as many WordPress instances as you like in subfolders example.com/test/ or subdomains test.example.com in one hosting account; see http://codex.wordpress.org/Installing_Multiple_Blogs. (You are, of course, limited if your host does not support subdomains. And you may find lots of sites with lots of traffic will slow your whole hosting account.)
For these separate WordPress installs, you can use the same database; simply give each WordPress install a different database table prefix in wp-config.php. https://codex.wordpress.org/Editing_wp-config.php Or, give them all the installs a totally different databases, only limited by your hosting account.
To control access to a WordPress site, there is no need for access control in .htaccess or via Cpanel; use any one of a number of plugins that allow you to restrict access to anyone not logged into WordPress. See https://wordpress.org/plugins/search.php?type=term&q=password
And you can still control the user's role when they are logged into the site with one of those plugins, i.e. editor, administrator, etc., from within WordPress. That's because you want to give a client a Subscriber user level so they can simply login and view the site, rather than Administrator, who can see posts, plugins, etc. See https://codex.wordpress.org/Roles_and_Capabilities
There is no need for WordPress Multisite, unless you want to go that way: see https://codex.wordpress.org/Create_A_Network But be aware that MS requires more server and DNS configurations if you want to use Domain Mapping: https://wordpress.org/plugins/wordpress-mu-domain-mapping/

Two domains on same WP site, but different header

I'm using Wordpress for a client's website and this client asked me if he could have two domains with the same content, but a different logo on top of the page. So for example:
www.website1.com with logo1
www.website2.com with logo2
Both with same theme & contents.
I was thinking of a double WP install, but then you have to do every change two times. I read something about multisites in Wordpress, but could not find out how to do this.
I hope someone can help me out, thanks!
On the SEO front this is a bad idea, you will duplicate all content Google won't know what to value more. But if you really want it.
you could do this with two wp install's but there are problems.
First set your site url's in the wp-config
Second let both installs connect to the same database. The change in
header can be detected with $_REQUEST (google it)
Now there are 2 problems left which I don't know how to fix.
The uploads folder need to be synchronized so each site can access the uploads
the solution will be with simlinks stuff. (which I'm not familiar with)
And your hosting provider has to allow it.
If you add an internal link in your post/pages it will prepend the complete site url, and save this hard coded in the database.
The solution of this could be in the editor, of to filter the content before it is printed.
If you want to go this way I'm willing to look further into these problems
Here is a relatively recent article on how to set a multisite wordpress network up.

Resources