Last post Sep 14, 2008 12:15 AM by malikvakaz
Sep 05, 2008 01:46 PM|Bo Chen – MSFT|LINK
Currently I'm building an asp.net web site using HttpModule rewritter and everything works fine . However, I need to provide a fake page extention which is in aspx format(e.g. test.aspx) to have IIS route requests to asp.net work process. This makes the
page url look extremly ugly and I've determined to remove it.
I've searched thru internet and have got 2 resolutions: 1st choice is to prepare a dummy index.aspx file within each virtual directory and the second one is to write a custom IIS ISAPI. I'm planing to use the latter solution and have installed Visual C++
6.0 on my machine. However, one of my friend tells that I can do it using HttpModules in asp.net and I really doubt it(I'm not 100% sure that it cannot be done using IHttpModule, but 90% maybe). I'm posting the question here just want to know how does other
ppl do this. And if you have got such kind of experience, please kindly tell me. Thanks in advance.
Sep 05, 2008 02:17 PM|docluv|LINK
You can map any file extension to be processed by ASP.NET. Just map that file extension through the aspnet dll. You of course need to check off the setting that ensures the file actually exists. I am actually looking to do this as a way to trick Search Engine
bots to see if Google punishes ASPX files, or I guess I should say gives more credence to other web technologies.
The ASP.NET page life cycle will still hold true, so you have all the same events to hook into in a custom httpModule.
Sep 06, 2008 04:04 AM|Bo Chen – MSFT|LINK
You can map any file extension to be processed by ASP.NET. Just map that file extension through the aspnet dll. You of course need to check off the setting that ensures the file actually exists.
I don't think you have understood my problem. Of course we can map any file extension to asp.net, while what I'm taking about is to map files *which do not have a file extension * to asp.net. Like this:
http://forums.asp.net/Reply/2603567/ (Note there is no file extension)---->should be mapped to:
I think the work should be down Out Side Of asp.net, i.e, this cannot be down using IHttpModule.
Am I right, hope somebody could correct me if I understand things wrong
Sep 12, 2008 03:02 PM|docluv|LINK
No I understand what you are asking. You have to route all request through the ASP.NET engine in IIS. Then you can do whatever you want with the request in ASP.NET.
Try it against the dev web server, everything is routed through it. All you have to do is a *.* mapping in the ISAPI filter section of IIS to route every request through aspnet.
Sep 14, 2008 12:15 AM|malikvakaz|LINK
Yes ISAPI is thee only solution as IIS 6 doesnt support extensionless URL rewriting you have to write ISAPI Filter for it, I have this experience you can acheive it easily.
try this link
http://www.codeproject.com/KB/ISAPI/isapiredirector.aspx it will give you the url and you can play with the url. Just get Url and parse it rewrite it.
Address bar will show the nice url although your page will be still like test.aspx or any bad url...
If you face any problem then dont forget to post again... :)
.net postback url rewriting extensionless mapping