locked
One website with different clients RRS feed

  • Question

  • User708123575 posted

    Hi,

    I am hoping someone can shed some insight. I am not really looking for a specific answer maybe just the best approach to follow.

    I have built a web application that utilizes ASP.net theming to differentiate between various corporate clients using it. Obvious reason being that every corporate will have their own special styling.

    What is have done to date is to identify the corporate customer based on a querystring value before setting the Page theme accordingly.

    i already have problems in my application regarding session timeouts etc., not want to go into detail.

    I then looked at having individual sub sub domains, i.e

    corporate1.subdomain.domain.com and corporate2.subdomain.domain.com etc etc 

    Is this advisebale ?

    Would i have to specifically set up the DNS every single time ?

    Can this be handled via url rewriting ?

    Monday, March 18, 2013 9:23 AM

Answers

  • User-902516579 posted

    Hi,

    You might consider having a login page so you know who is accessing the site and you could also know what company they work at.  Store this information in a database.

    Then you can create a number of MasterPages and dynamically choose them based on the company the user is assocaited to.

    HTH, Benjamin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 22, 2013 11:06 AM
  • User1124521738 posted

    one technique I have used is have a wildcard subdomain so each of these companies would be company1.portal.mywhitelableportal.com, company2.portal.mywhitelableportal.com, company3.portal.mywhitelableportal.com - but in DNS it is *.portal.mywhitelableportal.com that points to your server's IP address for the IIS instance hosting the application, and in IIS, just set the site instance it to respond on any hostname (don't have any other sites on the same IP address as this application). 

    If you do wildcard mapping in DNS you shouldn't need to touch it every time you add a new site.  Where I used to work we did a wildcard subdomain for our client preview sites and didn't have to touch dns except when we moved our server to another data center, we were able to spin up new IIS instances and just added <specific-site>.dev.ourcompany.com as the site binding.

    then you can go and set up a small database table (or some kind of config file) that maps the company specific variant of the sub domain like company1.portal.mywhitelableportal.com to the list of stylesheets & master pages (depending on how you load alternate stylings) and use that to switch on rather than the querystring parameter or just take the querystring parameter values you already have and drop it into the table and query the table using the subdomain as the lookup key.

    I have followed this exact technique in my open source CMS to make it multitennant allowing me to have multiple different sites sharing the same webroot.  It takes the requesting domain name and queries a list to determine which content should be returned to the user.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 1, 2013 4:02 PM

All replies

  • User-902516579 posted

    Hi,

    You might consider having a login page so you know who is accessing the site and you could also know what company they work at.  Store this information in a database.

    Then you can create a number of MasterPages and dynamically choose them based on the company the user is assocaited to.

    HTH, Benjamin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 22, 2013 11:06 AM
  • User-1716951449 posted

    ...

    I then looked at having individual sub sub domains, i.e

    corporate1.subdomain.domain.com and corporate2.subdomain.domain.com etc etc 

    Is this advisebale ?

    Would i have to specifically set up the DNS every single time ?

    Can this be handled via url rewriting ?

     

    setting up multiple domains seem good to me. as each customer will have their more unique domain.

    and in future, in case you want to split or separate manage them, more easy.

    i don't think you need url rewriting, this domain is purely iis and networking binding, look/research into host header, or talk with your sys engineer.

    you can use ASP.NET to identify the current domain, equivalent as passing query-string

    Monday, March 25, 2013 4:04 AM
  • User1124521738 posted

    one technique I have used is have a wildcard subdomain so each of these companies would be company1.portal.mywhitelableportal.com, company2.portal.mywhitelableportal.com, company3.portal.mywhitelableportal.com - but in DNS it is *.portal.mywhitelableportal.com that points to your server's IP address for the IIS instance hosting the application, and in IIS, just set the site instance it to respond on any hostname (don't have any other sites on the same IP address as this application). 

    If you do wildcard mapping in DNS you shouldn't need to touch it every time you add a new site.  Where I used to work we did a wildcard subdomain for our client preview sites and didn't have to touch dns except when we moved our server to another data center, we were able to spin up new IIS instances and just added <specific-site>.dev.ourcompany.com as the site binding.

    then you can go and set up a small database table (or some kind of config file) that maps the company specific variant of the sub domain like company1.portal.mywhitelableportal.com to the list of stylesheets & master pages (depending on how you load alternate stylings) and use that to switch on rather than the querystring parameter or just take the querystring parameter values you already have and drop it into the table and query the table using the subdomain as the lookup key.

    I have followed this exact technique in my open source CMS to make it multitennant allowing me to have multiple different sites sharing the same webroot.  It takes the requesting domain name and queries a list to determine which content should be returned to the user.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 1, 2013 4:02 PM
  • User1428318736 posted

    in simple words, identify the user and do a mapping of corrosponding prefs settings...so at first place, ur arch shud ve that flexibility and if its a new design then u need to design it that way.

    Friday, April 12, 2013 4:54 PM