Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This <em>should</em> be possible and I have achieved similar outcomes with code developed that way from the start. As you are retrofitting this in it's going to be a lot harder, but that's separate to your actual question.</p> <p>To answer your actual points:</p> <ul> <li><p>Presumably your DB connection string is already in a application variable or settings file? If so, you just need some logic in your global.asa Session_OnStart that reads the host header and selects the appropriate DB string. This could be hard coded or you could have a "control" DB that stores sites, their DB strings file paths etc and pulls the details into the session object.</p></li> <li><p>This is related to the above, pull your cache storage locations from the DB, or have a "directory name friendly" base name for each site, so you can have <code>"/masterapp/" &amp; Session("strSiteBaseName") &amp; "/cache/somefile.htm"</code> </p></li> <li><p>If you're on IIS7 then you can use the URL rewrite module to handle this, if you're on IIS6 there are 3rd party tools you can get to do URL rewriting for you. Again I have done this so can vouch for it working. If you want to get really clever, you can have your master app create the rewrite files for you and "touch" web.config to get them loaded into IIS.</p></li> </ul> <p>One "gotcha" you'll have with host headers is remember to handle www and no-www records!</p> <p>You mentioned custom code as well for each site, I haven't done this in production but have tested outside an app and you can rewrite functions after they've already been declared. You can't have includes with variable names, but you can load in a text file and execute it, so there is a way to have custom functions, or changed core functions specific to an individual instance of your over-arching app.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload