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.
PHP code for add in new addon domain like cPanel
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: PHP code for add in new addon domain like cPanel
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.
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
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?
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?