Active4 years, 6 months ago
I've created a website in asp.net mvc4 and i've put it online with specific domain name. Now my client asks to replicate same website on different domain name, and change some static texts/images to distinguish the 2 websites. I'd like to handle just one source code and deploy two times. How i can reach this?
PremierPremierThere are several ways to manage multiple websites from the same platform. Here are 6 of the best alternatives available.
1,99555 gold badges3333 silver badges4949 bronze badges
2 Answers
We did this a few years ago with a web application. It was a pain in the a**. We had one website running and the resources were loaded after the user has logged in.During the development you always had to think about that, split the resources always look for the logged in user etc.
It is just easier to copy the published application to a second folder and for the static texts use some kind of resource files that can be replaced on the fly.As long as you don't have images and files that are a few gigabytes big it should be no problem to copy the compiled source code an the resources.
JoeJoe87577JoeJoe87577
Though kind of a too late reply, but I just wanted to share some of my experience with you, you can follow these steps, it won't take too much of your time.
- Identify the various text / images like logo for branding etc for which you have a requirement to make them tenant specific.
- Create a table called tenant settings (tenantid, key, value )
- Identify the pages that needs to be tweaked to look up from this setting than a hardcoded value.
- Update these pages and provide a UI for each tenant so that they can change the values at any point of time
This way you can achieve the level 4 multi-tenancy with minimal effort to begin with.
HTH
SaravananSaravanan5,19233 gold badges3131 silver badges6464 bronze badges