You are currently viewing “How to Park Domains”. A detailed walkthrough

“How to Park Domains”. A detailed walkthrough

  • Post published:March 25, 2014

How-to-Park-Domains-A-detailed-walkthroughClient sent a requirement to the developer Aqeel Shamas to create a feature in the multi-site CMS Platform which will allow his customers to park their domains on that platform to use CMS services instead of the manual sub-domain creation process. The task was very challenging and required lots of R&D to translate the requirements into actual a product feature. The developer took the challenge and left no stone unturned to find a solution to achieve the goal.

Parked Domains and CMS

Parked domains are often used by businesses who want to have more than one web address for advertising purposes. Parked domains are additional domains hosted on your account which display the same website as your primary domain and share web statistics as well; however, you can also give the parked domain its own email boxes.
For example, if you own and it is the primary domain of your cPanel account, you can set up as a parked domain and it will load the content of When you visit, you will notice that although the content of is loading in the browser, the address bar will display This is similar to a masked forward.

How to Park a Domain with PHP and cPanel: Prerequisites

  • Your application must have ability to understand and distinguish between sub-domains.
  • Database architecture to save association between internal CMS system sub-domain and parked domain.
  • Server with cPanel license.
  • Should be familiar with cPanel scripting and XML APIs.
  • Knowledge of parked domains and using name servers to point domains.
  • Custom configuration files and custom settings for each parked or sub-domain.

Solution: Process and Execution

  • Saved association between sub-domain and parked domain in database.
  • Provided an interface to user for parking domain in admin panel of CMS.
  • Pointed the parked domain to CMS server by using name servers: e.g.
  • cPanel scripts execution to park domain on CMS server through shell or cPanel API .
  • Implemented a code routine to parse/understand the requested URL.
  • If identified as parked domain URL:
    • Fetched associated underlying subdomain from database and loaded its custom configuration file containing the custom settings for the parked domain.
    • Served the request and displayed the user CMS site.
  • If identified as normal CMS system URL containing the customer subdomain:
    • Loaded CMS subdomain configurations.
    • Served the request and displayed the user CMS site.
  • After load system’s configuration file, created an instance of YII application and performed required execution to serve the request.