user34537
user34537

Reputation:

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?

Upvotes: 0

Views: 158

Answers (1)

SLaks
SLaks

Reputation: 887449

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.

EDIT

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

Upvotes: 3

Related Questions