Best Jquery ,javascript, HTML5 CSS3 tutorial with jquery examples, php script , demos for beginners, web designers and web developers.

Jquery

Jquery Training

Jquery training blog

Create dynamic subdomain in PHP and Htaccess

Subdomain A subdomain also called a child domain, is part of a larger domain name in Domain name system (DNS) hierarchy. DNS hierarchy consists of the root-level domain at the top, below which there are the top-level domains, then second-level domains and finally subdomains The Domain name system (DNS) mainain a hierarchy, with each non-RR (resource record) Continue Reading


Subdomain

A subdomain also called a child domain, is part of a larger domain name in Domain name system (DNS) hierarchy. DNS hierarchy consists of the root-level domain at the top, below which there are the top-level domains, then second-level domains and finally subdomains

The Domain name system (DNS) mainain a hierarchy, with each non-RR (resource record) node on the hierarchy being a domain name.

Suppose a domain www.jquerytraining.com then the subdomain of the website may be php.jquerytraining.com or css.jquerytraining.com etc

Generally, a subdomain is preferred over a sub-directory in cases where the content of the sub-domain is not related to the content of the main site.

Everybody looking for better solution for dynamic sub domain for their domain, like Google Blogger and Tumblr.com.

Traditionally, a subdomain in PHP is created manually from the cpanel. To do so, a developer has to enter information such as the name of the subdomain, the domain under which it has to be created.

This process works completely fine if there is only one or a two sub domains to be made. But often, there arises a situation when multiple subdomains are needed to be created dynamically on user actions such as in the case of websites like Tumblr.com.

The following steps are to be taken to setup dynamic sub domain.

Open the domain admin panel
Go to your domain DNS(Domain Name System) settings -> click add zone record.
Now we  need to create a custom A record to serve all your subdomains.
Select A record, HOST * POINTS TO: Your IP Address
Repeat the same for HOST @, here is the listed A records.
Now add CNAME record, HOST www POINTS TO @ this refers to your IP address.
CNAME list should be in following way. then save

This is the way we can create dynamic subdomain

Please follow and like us:






About the author

Joydeb Choudhury holds a Master's degree in Computer Application from I.G.N.O.U. After working as a web developer in various companies he has started bloging in 2016.

Recent Posts of blog

Downalod Free Php Scripts