Link to home
Start Free TrialLog in
Avatar of GlennGilbert
GlennGilbert

asked on

Application_BeginRequest not firing when xxx.aspx file not found (using RewritePath in application)

I've been using Application_BeginRequest to call a function to parse the URL and RewritePath to a known .aspx file.  This has been working fine with many ISPs,  but on installing the application on a new ISP,  Application_BeginRequest isn't firing and a 404 error results.

I've had this problem some time ago with a different ISP who fixed it but didn't tell me what they did :-(

I believe there's a setting in Machine.config that enables virtual paths but I've not been able to find any documentation on this.

Any ideas?

This problem is rather urgent and embarrassing,  hence it's worth lots of points -- I would award it more than 500 if I could!

TIA,  Glenn


Further info:
It's a content management application that uses 'friendly' urls and exploits Application_BeginRequest with RewritePath to call the correct skin aspx file,  thus separating form from function.

It's been working fine on loads of different systems and ISPs and it's only ever failed on two separate ISPs,  the earlier one which fixed the problem (and didn't let me know what they did!),  and this new ISP.

It's running framework vn 1.1
Avatar of GlennGilbert
GlennGilbert

ASKER

I've found the answer after a *lot* of digging and I thought I'd share it with everyone.

The problem is a setting on IIS that checks if a file exists before calling Application_BeginRequest.  If this option is set ON,  IIS will throw a 404 error and not fire the Applciation_BeginRequest event.  If it's off,  the event is fired.

This is a setting in IIS:
IIS/Website/Properties/Home Directory/Configuration/Mappings/.aspx/Edit

In IIS6,  Change the setting "Verify that file exists" to OFF
In IIS5,  Change the setting "Check that file exists" to OFF

End of problem.

How do I award the points to myself?
Glenn

ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial