Tuesday, August 30, 2016

Dot in URL in ASP.NET MVC causes 404 error

URLs with dot (.) generate a 404 error. This happens irrespective of whether scaffolding is used or not.

Solution

This can be fixed by enabling RAMMFAR (runAllManagedModulesForAllRequests). The RAMMFAR setting is for per application. Enabling this option will enable all managed modules for all requests. That means static files such as images, PDFs and everything else will be processed by .NET

A smart solution is to add a new HTTP handler that looks for specific path criteria.

Add the following to the site's web.config within the and element