Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple domains, same web application on IIS 6

Tags:

asp.net

iis

On IIS 6, is it possible to have multiple domain names pointing to the same web application, and conditionally serve CSS from within the web application based on the domain name?

I need to host hundreds of different "skins" on the same web application, with the skin being dependent upon the domain name, and I really don't want to launch tons of web applications.

like image 246
Pittsburgh DBA Avatar asked Nov 07 '08 18:11

Pittsburgh DBA


2 Answers

+1 to rhinof for adding multiple identities, but creating a HttpModule is a bit over kill. You can simply switch the URL of the tag in a Master Page by examining the contents of Request.Headers["HOST"]

like image 71
Martin Brown Avatar answered Oct 11 '22 17:10

Martin Brown


1) add the desired domain names as website identifiers in the advanced property page of the Web Site Tab.

2) map the .css extension to the aspnet_isapi.dll

3) write an httpmodule that will re write the url for .css requests based on the domain name

4) enable your module via the web.config

like image 28
rhinof Avatar answered Oct 11 '22 17:10

rhinof