Net123 Posted August 22, 2012 Share Posted August 22, 2012 hello i am making a script that means a like "blog creator" now i am having trouble in creating sub domains don't wanna do it with wild cards and .htaccess tricks ...it can be made some errors and i can't send queries about the user the their folder means(sub domains) if i sended query string for identify the site then no anyone would like my site ..so i wanna create sub domains with script some of they mading this way and i am fell 'good in create sub domains using php i googled about this script but i can't the script or tutorials anywhere so i posted my question here anyone could help me ? i am using cpanel 11 version Link to comment Share on other sites More sharing options...
niche Posted August 22, 2012 Share Posted August 22, 2012 If you're just talking about folders in htdocs, that a job for php files. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2012 Share Posted August 22, 2012 If your host allows it then cPanel has an API that you can use to create a subdomain. There's also the issue of DNS though, you still need to update the DNS records for your domain to point the subdomain to the correct IP. http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WebHome#cPanel WHM's API Link to comment Share on other sites More sharing options...
Net123 Posted August 22, 2012 Author Share Posted August 22, 2012 i just wanna create folder's like "how cpanel submoain creator" i sit needs to add dns records ??i am not saying about how to create subdomain from web host manager "like account" my grammer could be little wrong b'coz i dont know much Link to comment Share on other sites More sharing options...
Net123 Posted August 22, 2012 Author Share Posted August 22, 2012 and i also tested with some scripts but subdomain creation was not working Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2012 Share Posted August 22, 2012 I'm not sure what you're asking. Again, you can use cPanel's API to create a subdomain, and you also need to update your DNS records to point the new subdomain to your server. You said you don't want to use wildcards, so that means you have to update DNS records every time you add a subdomain. If you used a wildcard record then you wouldn't need to do that. Link to comment Share on other sites More sharing options...
Net123 Posted August 22, 2012 Author Share Posted August 22, 2012 oh are u saying about the api of cpanel......if i used this cpanel apihttps://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php andrequire_once('xmlapi.php.inc'); $xmlapi = new xmlapi('127.0.0.1'); $xmlapi->password_auth('root','password'); $xmlapi->set_debug(1); print $xmlapi->api1_query('accountname','SubDomain','addsubdomain',array('sub','domain.com',0,0,'/public_html/folder')) is it wil create subdomains in my server and will keep my dns ? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2012 Share Posted August 22, 2012 Check the links here: http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/WebHome#CpanelApi Specifically, the things under "Internal API". You'll probably want to use API 2, not API 1. Those links have a list of the functions that describe what each one does. Link to comment Share on other sites More sharing options...
kanchatchai Posted August 23, 2012 Share Posted August 23, 2012 May be work withRewriteRule in .htaccessand explode $_SERVER["REQUEST_URI"] in index.php Link to comment Share on other sites More sharing options...
Net123 Posted August 27, 2012 Author Share Posted August 27, 2012 oh i will try .... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now