URL Mapping

T

Tim_Mac

hi Jingxi,
i wrote an ISAPI filter that does just what you describe. the reason i
used ISAPI was because i wanted to have virtual folder URLs aswell as
page urls. so you can have myserver/Folder1/Folder2/ which gets
redirected to your DLL for server processing or whatever.
i have it set up to intercept all .html requests and requests for a
default document (i.e. for a folder) and to redirect them to
/content.aspx?Url=THE_ORIGINAL_URL.HTML

it ignores all other types of requests, .aspx, .asmx, .jpg etc.
you can see how i did it on my blog, and download the ISAPI filter. if
you have VS.Net, you can modify the solution to whatever you need.
http://tim.mackey.ie/PermaLink.aspx?guid=f3050e59-636f-4634-8a2b-8b1c0de17a5b

there are easier ways using the .Net framework, like setting up a new
script mapping for a file extension in IIS, i.e. you can set IIS to
treat .html files as .aspx files. but none of these options work with
non-existent foleder URLs. also, this filter logs the original url
that was requested, instead of /content.aspx?whatever... for each
request. the original url is presumed to be more interesting..

let me know if this helps your situation.

thanks
tim
 
T

Tim_Mac

i agree with brock.
but... if you want virtual folder urls, then ISAPI is the only way as
far as i know.
 
S

Steven Cheng[MSFT]

Thanks a lot for your informative inputs and the project you shared with
us, Tim_Mac,

Hi cjx,

I totally agree with Tim_Mac , if you want to intercept all kinds of coming
request (url contains an document extension or only a directory url ....),
the ISAPI filter is the only solution. ASP.NET's UrlRewriting can perfectly
handle dynamic document(with a certain extension)'s request redirection but
can not work for folder path.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top