First you need to set your main domain to act as a catch-all subdomain. its like putting ServerAlias * so that each subdomain which is requested to the main domain reaches the same place. I mean if your main domain root is /home/admin/abc.com/htdocs/ then your catch-all setup shall send all sub-domain requests to that same directory /home/admin/abc.com/htdocs/ and then in the index.php file of this directory you can do this global $domainname; global $subdomainname; $domainarray = explode('.', $_SERVER['HTTP_HOST']); $index=count($domainarray)-1; $domainname= $domainarray[$index-1].".".$domainarray[$index]; $subdomainname=""; for($i=0;$i { if($subdomainname=="") { $subdomainname=$domainarray[$i]; } else { $subdomainname=$subdomainname.".".$domainarray[$i]; } } ShowCustomizedPageForsubdomain($subdomainname); ?> This function ShowCustomizedPageForsubdomain($subdomainname) can be easily implemented in two ways: 1) Either your stor...
As a seasoned expert in AI, Machine Learning, Generative AI, IoT and Robotics, I empower innovators and businesses to harness the potential of emerging technologies. With a passion for sharing knowledge, I curate insightful articles, tutorials and news on the latest advancements in AI, Robotics, Data Science, Cloud Computing and Open Source technologies. Hire Me Unlock cutting-edge solutions for your business. With expertise spanning AI, GenAI, IoT and Robotics, I deliver tailor services.