Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC3 app - HTTP Error 404.7 for route with double dot

Tags:

asp.net-mvc

Routing:

        context.MapRoute(
            "Dashboard_default",
            "Dashboard/{controller}/{action}/{jobName}",
            new { action = "Index", controller = "Dashboard", jobName = UrlParameter.Optional }
        );

But for Route

http://localhost/candidate/Dashboard/Overview/Show/sdfdsf.xx.dd

I recieve:

HTTP Error 404.7 - Not Found The request filtering module is configured to deny the file extension.

In the same time, route

http://localhost/candidate/Dashboard/Overview/Show/sdfdsf.xx

Gives right response.

I assume some issue with IIS, have anyone seen that before?

like image 914
Alexander Beletsky Avatar asked Aug 31 '25 10:08

Alexander Beletsky


1 Answers

To allow that particular url, in your web.config you could add this:

<system.webServer>
    <security>
      <requestFiltering>
        <fileExtensions>
          <remove fileExtension=".dd" />
        </fileExtensions>
      </requestFiltering>
    </security>
  </system.webServer>

Otherwise, you could add a <clear /> inside of fileExtensions to allow any file to be routed.

like image 124
bkaid Avatar answered Sep 04 '25 03:09

bkaid