Tutorial :Why is the server ignoring rewrite on non ASPX files?


Locally this works but on the server when i do something like /user/profile i get a 404 however if i do /user/profile.aspx it works. I also rewrite images from /s/example.png to /localLocation/example.png, this doesnt work. If i write /localLocation/example.png it does show up however it defeats the purpose of my rewriting. Also if i attach a .aspx to the end of any path i get a default page which shows the address of the rewrite. It is correct but only if i add .aspx. How do i get the server to apply the rewrite to all paths?


The problem is that IIS only invokes ASP .Net for certain extensions.

You need to configure IIS to use ASP .Net to handle every extension that you want to rewrite.


If your web host runs IIS 7 in Integrated Mode (ask them), you need to add the HttpModule that handles the rewriting to the modules tag in system.webserver. See here

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »