Hi,
I have a server with cpanal and whm on so i can manually create hosting accounts. I have whm setup with different levels of packages from free to all singing packages. For the free ones I'd like users to use a subdomain like www.sub.domain.com where 'sub' is there user name.
Has anyone had any experience of PHP based script/solutions that will allow:
- automated account signup and setup based on the packages in whm
- differentiate between free and paid packages so that free packages use a subdomain
- use paypal to collect payment for paid hosting
I've looked around and cant seem to find anything that meets my needs, so if anyone knows of a product ore has had experience of a solution advice would be greatly appreciated.
Offline
Hey,
I have been doing this with Dynamic PHP + use of .htaccess file.
This won't create any sub directory but will surely catch all the subdomain and will return to the page created for subdomain.
-------------------------------------
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/
-------------------------------------
Then in index page do this in the top of your page
$domain = $_SERVER['HTTP_HOST'];
$domain_parts = explode('.',$domain);
if (count($domain_parts) == 3 && $domain_parts[0]!= "www") { // make sure a subdomain is called
$user = $domain_parts[0];
$loc = "http://domain.tld/whateverpage.ext?varname=$user";
@header("Location:$loc");
}
-------------------------------------
Let me know if this helps.
Offline