I am working on a project where we may have to host many sub-websites which are just folders off of the main website. THe problem here is there could be thousands. We want to get out of having a subfolder off the main website and a default document in each
folder that redirects the visitor to the actual page that serves up the member content. What i want to do is have an HTTPHandler or HTTPModule that detects an incoming request for say: www.myportal.com/memberwebsite , then redirects them according to the request.
If i use a handler, i have to create a custom file extension, but i am wondering if that is the best way to do this. So if someone goes to myportal.com/member1.smp , i grab that file requested and do a lookup in the database and find member1, then pass them
to a page that dynamically serves up the member1 content. Can anyone provide any help or advice in accomplishing this? Thanks very much! - rem
Sincerely,
remedy
MCP + Senior .NET Developer
Vista: Worth every penny.
I would use an httpmodule, it is perfect for this task. From your module you can handle the application.beginrequest event and check the db for your member, then pass them on to appropriate page. It's the exact tool your looking for. here is a link that some
one gave me on this forum once.
http://www.devx.com/dotnet/Article/6962/1954?pf=true Check out the section on httpModules. Also if for some reason you still want to go with the handler you don't need to make a custom extention, you can use the built in .ashx extension which will make
deployment much easier....... although if you look at my post a few down from this one you can see that I didn't particularly enjoy working with them, haha.
Member
1 Points
73 Posts
Matching incoming requests against database to serve content. HTTPHandler or HTTPModule?
Jan 14, 2005 04:46 PM|remedy|LINK
remedy
MCP + Senior .NET Developer
Vista: Worth every penny.
Member
20 Points
126 Posts
Re: Matching incoming requests against database to serve content. HTTPHandler or HTTPModule?
Jan 14, 2005 05:43 PM|Jeremy123|LINK