Best practice for multiple "companies" in one database/site

G

Guest

Hello,

I have a large commerce app, hosted for several hundred companies (i.e. each
"company" is a small business selling something through my site, independent
of all the others).

Each company has a unique ID (e.g. 12345), which is a primary key in the
tables for products, customers, etc. That key also identifies
company-specific customization of my site, such as text strings, various
styles, etc.

I am hosting the app for all customers from a single site and with a single
database. The end customers come to my/my customer's site in one of three
ways: 1) via me.com/myCustomer or 2) via myCustomer.me.com or 3) via
myCustomer.com.

Given all that, here's my question: When a customer comes in via one of the
three ways, how do I then map that to the url I really want, e.g.
me.com?CompanyID=12345? (I have a table that associates the entry point with
the actual ID)

I think it might involve url rewriting, but I've not done that, and there
might be better ways. Any "best practice" thoughts from similar situations
are appreciated.

tia,

Bill
 
K

Kevin Spencer

Hi Bill,

It's really a simple matter of redirecting with a QueryString. Of course,
I'm assuming that you do have a method in place that identifies the Comany
ID of the company.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
K

Karl Seguin

I agree with your assessment that URL Rewriting would be the way to go. I
wrote a bit about it at:
http://openmymind.net/localization/index2.html#urlrewrite

it's with respect to cultures, but you should be able to use it for your own
needs.

The basic idea is on Begin_Request you figure out the customer id (via your
association table) and simply do a
Context.RewritePath("index.aspx?CompanyId=" + CompanyId.ToString());

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top