Hello Every1,
i'm using "webhostingpad" for hosting my website.....n i dont have access to httpd.conf & they even dont allow wildcard redirect...

but they are providing me unlimited subdomains...

is there neway 2 make dynamic subdomain for every new user register 2 my website.....accept making it own 4m cpanel......

every and any suggestion would be appreciated

Thanks
Kunal

this can help you

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<$index-1;$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 store Page's Html in your database and all this function would do is to pick up that html code for the provided sub-domain from the database and simply
"echo" or "print" it.
2) or you can simply have standard actual pages for each subdomain and you simply include them here like this

ob_start();
include "http://url_of_the_page_you_want_to_show";
$data=ob_get_contents();
ob_clean();

this Object buffer will return you that page's content in the variable "$data"; you simply echo $data;

hmm , going more deep, Second Implementation of your function is like this

function ShowCustomizedPageForsubdomain($subdomainname)
{
ob_start();
include "http://url_of_the_page_you_want_to_show_for_this_subdomain";
$data=ob_get_contents();
ob_clean();
echo $data;
}

this can help you

Well Bzzbee
How can i set my domain to catch all subdomain....as i dont have access to httpd.conf..
i only have access to .htaccess

can u suggest sumthing now

This article has been dead for over six months. Start a new discussion instead.