Page 1 of 1

PHP code for add in new addon domain like cPanel

Posted: Tue Oct 28, 2008 1:45 am
by cohq82
I have a website using drupal. I want to be able to have users to use their own domain name. For example, my website is http://www.website.com/userA and if user go to usera.com it will be http://www.website.com/userA instead.

I see that in cPanel there is a feature call Addon Domain where I can setup redirection for a domain to point to a specific file or folder. How to program this in the backend using PHP? Or is this only something that host provider can do? Thanks.

Re: PHP code for add in new addon domain like cPanel

Posted: Tue Oct 28, 2008 4:18 am
by aceconcepts
In order to do this, the nameservers of the user's domain will need to be renamed to the destination domain and then a sub folder such as userA will need to be created. The change of the nameservers can take up to 48hrs.

In my mind this is something that will have to be done via the hosting company.

Re: PHP code for add in new addon domain like cPanel

Posted: Wed Oct 29, 2008 12:39 am
by cohq82
What I understand is that there are 2 parts:

1. Change DNS of user's domain name

2. Configure add-on domain name to point to a specific folder or file.

The 1st part can be done by users. For second part, I know my hosting company uses cPanel which is PHP anyways and they provide the admin to configure that. How do I program that? Is it required dedicated server? cPanel must use some API to do it, right?