Avatar of WestCoast_BC
WestCoast_BC
Flag for Canada asked on

Can I have multiple sites sharing the same codebase?

I have multiple sites using Coldfusion 11 and each site uses a MySQL database. Since each of my sites each use a copy of the same codebase I am wondering if there is a way to configure things so that I can have multiple websites share the same codebase. For example, www.sample.com, www.anothersite.com, test.sample.com and mysite.anothersite.com would all use the same codebase but use their own database and the URL is preserved when viewing the site.

Is there a way to configure this?

Thank you
Web DevelopmentColdFusion Language

Avatar of undefined
Last Comment
WestCoast_BC

8/22/2022 - Mon
Alexandre Simões

Where are you deploying your website?

The best option is probably to deploy it separately by domain.
What you describe is not a simple configuration/infrastructure problem, the application itself must need to be developed with that kind of usage in mind.
WestCoast_BC

ASKER
Right now my sites are sitting on a shared server.
WestCoast_BC

ASKER
I was looking at this post: how to run multiple sites on same codebase in ColdFusion base on domain or subdomain

and see that they suggest the following:
<CFIF not CGI.HTTP_HOST EQ "www.example.com" AND not CGI.HTTP_HOST EQ "example.com">
       <CFSET Application.Environment = "Dev">
       ...
     <CFELSE>
       <CFSET Application.Environment = "Prod">
       ...             
     </CFIF>

Open in new window


Can I have multiple domains and subdomains all point to the same IP address and still preserve the URL that is displayed when someone is viewing the site?
Your help has saved me hundreds of hours of internet surfing.
fblack61
Alexandre Simões

But which is the application server?

Apache? NginX?...
What is the current configuration? Multiple applications per website?
Does you website support multiple tenants?
SOLUTION
Alexandre Simões

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Mlanda T

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
gdemaria

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
WestCoast_BC

ASKER
Thank you everyone for all of your advice.  I will give it a try tonight.