简体   繁体   中英

Errror 404 in httpmodule on IIS6 asp.net 3.5

I have created a simple URL rewrite module in an asp.net 3.5 webforms website. The module redirects to /default.aspx using this code :

HttpApplication app = (HttpApplication)source;

HttpContext ctx = app.Context;

ctx.RewritePath("~/default.aspx");

return;

Locally on vs2010 it works fine (it redirects all requests). On the server it gives me error 404 when request file does not exist else if the request points to an existing page it redirects fine. Can you please help me find what is the problem that gives me 404 errors ?

SOVLED : The problem with IIS6 is that it does fire an asp.net httpmodule only if the extension of the given url is .aspx.

您是否尝试过检查警告消息

computermanagment>>windowslog>>application

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM