Jump to content

auto domain forwarding & subdomain creation


eccen

Recommended Posts

I am wondering if it possible to have a domain forwarded to a certain url upon domain purchase.

 

For example, when a customer purchase a domain name "site.com" it automatically forwards to a variable $url which points to "hosting.com/abc/" or so.

 

Also, is there anyway to create subdomain along with the private domain purchased automatically? From the example above, it will create a subdomain "abc.hosting.com" as well as forwarding "site.com" to "hosting.com/abc".

 

 

Oh, I am using Directi as a registrar... maybe I should checkout their API. anyway please let me know if anyone can help me out :)

Link to comment
Share on other sites

Your registrar really has nothing to do with this unless you are purchasing your forwarding service from them.

 

If you asking for a way to do it on all orders then it's probably easiest to set it up via the control panel you are using. For instance CPanel has a script that's run after the account is created, you can setup forwarding and subdomains using that.

 

If your asking for how to do it on only specific orders, WHMCS does not have this capability as it's really an API issue (if the control panel even supports it) and the API's are encoded. You'd have to write a custom one.

Link to comment
Share on other sites

  • 3 weeks later...

I handle the parked domains (those without a hosting account or assigned as a sub-domain) by just adding it to DNS. On cpanel, just run the following command:

/scripts/add_dns --domain parked.com

 

I've modified the default page for the web server (/usr/local/apache/htdocs/index.html) to be a generic "coming soon" page, which happens to be the same as the skeleton page used with new sites.

 

I would like to see an option with WHMCS to ask what to do with the 2nd or 3rd domains added to an order:

You already have a domain assigned to your hosting account, what would like to do with this new domain?

1 - Add as a sub-domain (in cPanel this is a sub-domain)

2 - Add as a domain alias (in cPanel this is a parked page)

3 - Park it (just add to DNS on designated name servers)

Link to comment
Share on other sites

  • 1 year later...

Apparently there is an API call to park a domain on top of another one... Here is the api call:

https://CPANEL-SERVER.COM:2087/xml-api/cpanel?user=USERNAME&xmlin=<cpanelaction><module>Park</module><func>park</func><apiversion>1</apiversion><args>PARKED.COM</args></cpanelaction>

 

CPANEL-SERVER.COM is your cpanel hostname

USERNAME is the cpanel user name

PARKED.COM is the parked domain name

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated