.NET, multiple sites on one web application. urlrewrite?? and a lot of sub domains
First of all I explain the current web application and then I try to explain how i think i want it to be..
Currently i use classic ASP, but i will convert to .NET in the future. Thats actually why i want to change the current configuration. I have a site where every user has their own subdomain. but they use the same asp application files.
files.mydomain.com <--- This is where the .asp files are located.
user1.mydomain.com .... user900.mydomain.com
(yes.. a lot of sub domains!)
all these sub domains has all the files that is needed for the presentation of the web application, and a ID.inc file.. but, there is no code in the files, only the following code:
-----
<!--#Include file="id.inc"-->
<!--#Include file="../../mydomain.com/public_html/file1.asp"-->
-----
except for the ID file wich is just an ID.
user1's id file has the following code: "accountID = 1"Beyond all the asp files, the sub domains also has a folder with all the uploaded files and images from the user. The asp files with the 2 include lines is created by asp.
everything works, and when the files in "files.mydomain.com" is updated all the sites is updated.
Except for the large number of subdomains, is there something bad with this solution?
The new solution:
I want to change the entire web applicaition to a .NET.
At first I planned to use the same method as above. Include files. But i dont know how .net handles include files?
The second plan, was to use wildcard DNS. And use asp to find the ID of the user.
But what happens if a user maps another domain adress to his account at my page?For example.
- User1 buys a domainnamn (www.user1.com) and point it to his subdomain at my site,
- user1.mydomain.com (not a开发者_开发知识库 redirect)
- when using wildcards, am i able to get the ID from the subdomain when the actual URL that he is using is www.user1.com or does the code only see "www.user1.com"?
I am not able to register all the domains that my users use..
The third allternative is url rewrite.
This is really new to me.Is it possible to rewrite both the subdomain, and ”folders” at the same time?
Lets say i have 1000 users, and all these have a couple of categories, and sub categories, and pages under all the categories.So the URL looks something like:
user1.mydomain.com/{virtual-categories}/{virtual-pageadress}.aspx
wich point to something like:
mydomain.com/page.aspx?categoryID=##&pageID=##
lets say that every user has about 100 url rewrites.
100 x 1000 = 100000 url rewrites... is that possible? And what happens when it increases to 10 millions? In one simple web.config file. Will the webpage be slow with an HUGE rewrite file?Thats why i still has some thoughts about using the physical sub domains.
But is it possible to create individually url rewrites, in each sub domain, but they all use the same .net files?Actually, I dont know wich path to choose. Please help me.
Short version:
I have a couple of hundred subdomains, soon maybe thousends. And all these needs individuall url rewrites.How do I proceed with this in asp.net?
Thank you very much!
You can use the URLRewrite Module to read information from your path, querystring and/or headers, and in turn either change the URL or poke the information into a header for your .ASPX file to make use of, so I do think you're on the right track. Here's some links to help you get started with URLRewrite:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ http://forums.iis.net/1152.aspx
精彩评论