NewFolder

Registered
Jul 17, 2012
2
0
1
cPanel Access Level
Root Administrator
Hi everyone,

I have a CMS that uses one database and selects different data for different websites simply by using a column called CUST_NO in every table. Now I need to set this up on cpanel. I have a WHM and can create cpanel accounts if needed. The database is also imported and ready to serve.
After many hours trying to figure out where to start I was hoping to get some startup help here.

My questions: Is it possible to forward domain1.com to the same PHP files and the same database as domain2.com and somehow get the correct data for the correct site?

I.E: A user browsing domain1.com would trigger the sql query SELECT COMPANY_NAME FROM TABLE WHERE CUST_NO=1.

Can someone point me in the right direction?

EDIT: The domains are external domains forwarded/redirected to my cpanel.
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
It should be possible for all to use the same database, but I'd suggest putting all domains on the same account and have each as an addon domain instead of using different accounts. This way all have access to the same cPanel database on that one account.

As for how to reference which files to use, does whoever created the CMS have any guide on doing it? It seems the files will need to call the correct data from the CMS. The files themselves have to be coded to call the right data. That itself would be a coding issue for grabbing the right data.
 

NewFolder

Registered
Jul 17, 2012
2
0
1
cPanel Access Level
Root Administrator
I have created this CMS myself. So I can do whatever I would like.

The problem is not technical but more practical. I could create a simple text file with a customer number in a specific folder for every customer that gets included in the database query. I guess this would be possible somehow in cpanel.

Another way would be to select data based on the url the request is coming from, if it is possible to send this url to the database somehow.

The Addon suggestion looks really interesting i will defenetly check it out.