blog posts

How to connect a subdomain to another host

Imagine that you own a company or store site and, for example, bought a shared host site with PrestaShop content management system on them. Now you have decided that for better branding, the news magazine section Or blog, launch your site with a content management system like WordPress. Still, your main web host may only be suitable for hosting a store site like PrestaShop, and WordPress may not work best on them, which many of The big sites and brands do is launch a subdomain inside their main site host and then buy a WordPress host that is dedicated to hosting WordPress. That subdomain turns its website into a WordPress host from another server. They connect, then they can develop their WordPress site without any restrictions and without the need for their main site to be crowded and uncontrollable in the best possible way, without buying and using multiple domains with domain names. Be different, connect a subdomain or sub-domains. Connect their website to different hosts.

But before we start, we will explain the procedure of this tutorial to you a little.

We have a C-panel host with the domain mizbanfatv. Ir, which is for a Joomla site, and now we have decided to create a subdomain inside these hosts called mag.mizbanfatv.ir, which is supposed to be part of the news magazine of our website, and we want a subdomain Connect mag to another host whose control panel is Direct Admin, and launch a site with a WordPress content management system on this subdomain.

Before starting the steps, there is a very important point: when connecting a subdomain to another host, we must observe whether the domain name connected to our main host is mizbanfatv. Ir and I want to buy another host To connect it to our main host subdomain. When buying a second host, we must put the name of the main domain connected to the host mizbanfatv. ir, which can now be done in two different ways:

  1. The first way is to put the name of the main domain connected to the secondary host ir and then create a subdomain inside the secondary host called mag.mizbanfatv.ir and connect this subdomain to the primary subdomain of the host and place our WordPress site in the sub directory Install secondary hosting domains.
  2. The second way is to put the main domain name of mizbanfatv. ir at the very beginning of buying secondary hosting and connect the primary subdomain to the secondary hosting itself and install the WordPress content management system in the public_html path of the secondary hosting.

We follow the first method in this tutorial, if you do not fully understand what we mean by now, there is no need to worry, we will teach you all the steps in full, really note that the main host of our site is that host. Our domain has dns that point to those hosts, and in the main host, we have to apply settings that the subdomain points to another host, please continue with this practical tutorial.

Build a subdomain in Direct Admin hosting

First we enter the secondary host, ie the same WordPress host whose direct control panel is admin, and from the right side of the control panel at the bottom of the current domain, we must make sure that the main domain name connected to these hosts is mizbanfatv.ir and as you can see This is it, and now from your account section, click on the subdomain management tool. Connect the subdomain to other hostsTo enter this page and create our desired subdomain, here in the Add Sub-Domain section inside this field, we must enter the name of our desired subdomain and write mag to finalize the subdomain’s creation. From here, click the create button. Connect the subdomain to other hostsAnd as you can see, our subdomain named mag.mizbanfatv.ir was created here and placed in this section. And the control panel is thirty panels.

Build a subdomain in the C-panel host

In the host C panel of our main website, from the right-side panel, i.e., general information from the primary domain section, we make sure that the main domain name of this web host is mizbanfatv—Ir, and as the character is the same. Connect the subdomain to other hostsNow we will go down a bit and from the Domains section, click on the subdomain icon to enter the C-panel host subdomains page. Connect the subdomain to other hostsHere, from the Create a Subdomain section, we decide to create a subdomain with the same subdomain name that we created in our WordPress host, so in the Subdomain field, we write the name of the subdomain we want and from. From the section, we note that the domain name mizbanfatv. Ir has been selected, and we have nothing to do with the other parts. And to finalize the creation of the subdomain, we click on the blue create button here. Connect the subdomain to other hostsTo see this green message and just seeing this message means that the subdomain is well created in C Panel, in the n. Instep from above, we click on the C Panel icon to return to the main page of the C Panel host control panel . Connect the subdomain to other hosts

Change the subdomain record in C Panel

Now when. We created the mag. mizbanfatv. Ir subdomain in C Panel, this subdomain is running from the same C Panel host by default, and now we want to make this subdomain connect to our admin direct host and run from there. To do this, we need to change the record of this subdomain created in the C Panel and connect it to one of them. To do this, we will g,o down again to reach the domain section and this time from here on the advanced zone editor tool. Click to enter it. Connect the subdomain to other hostsThis is where we can edit the node records inside our host on this. We scroll down a bit to get to the Zone File Records section. These are the records set on our site. The mag. mizbanfatv .ir record is the same as the sub. It is a domain that we cr, and now want to edit it to point to another host. To do this—click on the edit option in front of this record to open this drop-down menu. Connect the subdomain to other hostsHere we do not care about the values ​​in the fields name, TTL, and type. Still, the address field is the most important field we need to edit to see our current IP hosts. This subdomain is being called from these hosts; now, the important point and The heart of this tutorial is that if we want this subdomain to run from another host, we have to replace the host’s IP with the current IP. If you do not know the secondary IP of the host, ask from hosting company. We kept it in a file, then we. Then here and in this field, we delete the previous IP and put this IP. Note that. The note consists of 4 numeric parts separated by three points and nothing extra. We should not put another in this field. Now, to finalize these changes, click on the blue edit record button below. Connect the subdomain to other hosts