Install wordpress on subdomains - wordpress

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.

Related

Wordpress multisite: reusing domain

Good day 😀
I have a WP Multisite in which a site was running. The administrators decided they would revamp the site, and they did it in a provisional subdirectory so that the original site would be available while the changes took place. So this is the current structure:
mymultisite.com
mysite.com
mymultisite.com/mysitebeingremade
Now that the site changes have been finished, I would like to attach the domain name to the revamped site. So, I try to disable the site currently attached to mysite.com, change its domain to a different one, and attach the domain name to the revamped one. So from the sites configuration I make the following changes in Sites > Edit site > Site info:
mymultisite.com
mysite.com -> mymultisite.com/mysite
mymultisite.com/mysitebeingremade -> mysite.com
But it seems as if the domain name keeps pointing to the old site. What am I doing wrong? Or is it just impossible to reuse a domain name previously used in a multisite, but not in use anymore, for a new site?
I guess that I can just overwrite the original sites with the one with the changes, but I think it is too much hassle for a seemingly simple task.
Thank you 😀
Ok, I sorted it out.
It seems that, when you delete a site from the multisite, it doesn't get deleted from the database. Specifically, one entry remains in the table [prefix]_domain_mapping in which the fields 'id' and 'blog_id' are still pointing to the old site that was linked to that domain.
By changing those two fields to the id of the new site that will be using that domain name, and provided that all the changes have been made to the configuration of that site in the site configuration to use that domain for that site, it should work ok.
Thank you,

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

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/

Move wordpress installation from subdomain to root and keep links

ok this is bit weird question:
here is my domain: hfarazm.com
and wordpress installation at: blog.hfarazm.com
I have lots of visitors and they have shared my blog and article links all over.
I want to organize my site for separate section for tutorials, for blog, for portfolio and for other things.
Right now everything is going to blog.hfarazm.com i want to move blog to root but want to keep links so that users dont see 404 page and i get a chance to manage my site from the root.
I know: changing url in settings of wordpress will do the job but is redirecting is good practice? what is the better solution to achieve this confusing state.
You can create an .htaccess rules so your visitors will be redirected to new location, even if they type the URL blog.hfarazm.com.
See detailed information here.
Note that many of these examples won't work unchanged in your particular server configuration, so it's important that you understand them, rather than merely cutting and pasting the examples into your configuration.

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