URL rewriting to a common end point
        Posted  
        
            by sunil
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by sunil
        
        
        
        Published on 2010-06-10T17:36:02Z
        Indexed on 
            2010/06/10
            17:52 UTC
        
        
        Read the original article
        Hit count: 370
        
I want to create an asp.net white-label site http://whitelabel.com, that could be styled for each of our clients according to their specific needs. So for example, client abc would see the site in their corporate colours and be accessed through their specific url http://abc.com. Likewise client xyz would see the site in their own styling and url http://xyz.com. 
Typing either url, in effect, takes the user to http://whitelabel.com where the styling is applied, and the client's url structure is retained. 
I was thinking of URL rewriting using URLRewriter.Net (http://urlrewriter.net/), or similar, mapping the incoming address to a client id and applying the theme accordingly. So, a url rewrite rule may be something like
<rewrite url="http//abc.com/(.+)" to="~/$1?id=1" />
<rewrite url="http//xyz.com/(.+)" to="~/$1?id=2" />
I could then read the id, map it to the client, and with a bit of jiggery-pokery, apply the correct theme.
I was wondering if:
- this is the right approach ?
- I've overlooked something ?
- there is a better way to do this ?
Any suggestions would be appreciated.
© Stack Overflow or respective owner