In 3.5, I'm rewriting the url

to the following

I'm using this code to do it:


It works fine locally but when I upload to the remote web server, I get a 404 when trying to reference the above page. Any suggestions why it works locally but not remotely?

+2  A: 

You may need to create a wildcard mapping in IIS on the remote server so that all requests are processed by ASP.Net. If you do not do this any URLs without .ASPX on the end will not run through your URL rewriting code.

There is a good explanation of this (and other reasons you might use it) on Scott Guthrie's blog.

Generic Error
+1  A: 

Not "may" - you definitely need to create a wildcard mapping. Visual Studio uses the cassini web server which essentially passes all requests through .net. IIS only forwards specific mapped requests (by default .aspx, .asmx, etc..) to .net - rewriting a URL in requires adding a new mapping to get the request to in the first place


Sounds to me like the production server does not have a default aspx page, ie: default.aspx. If it did, it would reroute the request to your handler.

Easy way to verify this, would be to create a directory and place a default.aspx file in it and try to request it using only the dir name, ie: If that gives you a 404, then you know it for sure.

Ruvan Fernando