Create a Subdomain

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


How to Create or Add a Subdomain (in cPanel)

This website uses a registered domain mh370.wiki.

  • The top-level domain is .wiki
  • The registered domain is mh370.wiki
  • The prefix mw (MediaWiki) indicates a subdomain. The full name is mw.mh370.wiki.

I had previously created the subdomain to be used for this website, so the example below demonstrates the creation of a new subdomain demo.mh370.wiki.

This subdomain has since been removed.

Domains and cPanel

In cPanel select Domains to view a list of domains. This view also has a button to Create New Domain.

One cannot just 'create a domain'. The Domain List is intended for domains registered by the account holder, which usually includes DNS services. If an additional domain has been registered it can be added to the Domain List by the Create New Domain button.

However, end-users can create subdomains. For demonstration purposes I have created a subdomain demo on the domain mh370.wiki (which will be deleted later).

cPanel prompts for the Document Root (File System Location), adds a warning that 'If the document root is shared then the created domain will serve the same content as ...', and pre-fills the next box with a directory where the files for the domain will be.

There is a problem: a website will only be accessible over the Internet if it is located in /public/html. I changed the path, as below:-

And clicked Submit. cPanel responded 'It can take a moment to create a new domain. This occurs on accounts with a large number of domains.' Followed by a Success notification.

The new subdomain is now in the Domain List.

The folder demo.mh370.wiki was also created in the /public_html folder.

Note: MediaWiki should not be installed in this root directory. MediaWiki could be installed in /public_html/demo.mh370.wiki/w


Extra (Unwanted) Subdomains created by cPanel

Although the above example looks neat and tidy, cPanel treats each domain as though it is a subdomain of the main domain and consequently, if the original (main domain) for my website was example.com, and I added the domain mh370.wiki and a subdomain mw.mh370.wiki, cPanel would also add these in the domain list:-

  • mh370.wiki.example.com
  • mw.mh370.wiki.example.com

This is explained in a related article Subdomains and cPanel.



Articles which relate to Subdomains

Articles which relate to Subdomains are included in Category:Domains.

The CategoryTree Extension enables a listing of relevant sub-categories and pages:-