- Developers
-
-
-
Delivering purpose-built software solutions that build lasting client relations.
-
-
-
Web Development
- PHP
- Laravel
- WordPress
- Machine Learning
- UI/UX Engineers
-
-
-
Mobile Development
- Swift
- Android
- Java
- React Native
-
-
-
- Designers
-
-
-
Designing applications that reflect the values of your brand.
-
-
-
- About Us
- Blog
- Contact Us
Client 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 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 domain1.com and it is the primary domain of your cPanel account, you can set up domain2.com as a Park Domains and it will load the content of domain1.com. When you visit domain2.com, you will notice that although the content of domain1.com is loading in the browser, the address bar will display https://domain2.com/. 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.
- ns1.yourdomain.com
- ns2.yourdomain.com
- 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.
0 Comments