What are Subdomains
Domains with prefixes like store or blog etc. followed by the main domain are called subdomains. These are used to serve different variants or services under the same domain but as a separate website.
For example, if you have a business website example.com and you decide to sell products online later, You can create a subdomain like store.example.com apart from the main website.
What are different types of subdomains
Subdomains based on User Location – A website having https://ru.example.com for Russia and https://in.example.com for India.
Subdomains based on Language – Same website https://ru.example.com available in Russian language and https://ar.example.com available in Arabic.
Subdomain vs Subdirectories – what is different?
Crawlers like Googlebot consider Subdirectories as part of the domain and crawl them with the main domain. Whereas, Subdomains are considered as different websites.
How to Create Subdomain in Cpanel
Steps to Convert WordPress Page into Subdomain-
Get the Page Id of the page – Click on the Pages tab in the Dashboard. Then hover on edit below the page you want to serve on a subdomain, you’ll see the page_id in the bottom left corner as shown below-
Now, open the file manager in Cpanel & open the directory created when you created the subdomain.
For example, if your subdomain is blog.example.com, the directory will be public_html/blog/
Create an index.php file in the subdomain directory & paste the code below.
Congratulations, you have successfully created a subdomain for a WordPress page.
Try opening the newly created subdomain in browser.
Initially, you might face a not-secure problem for a subdomain, to fix that you need to install an additional SSL certificate for it as shown in the video tutorial-