Reputation: 16744
I have a route that basically looks like this:
Foo/{id}/Files/{*path}
I want it to match a URL such as:
http://mysite/Foo/Bar/Files/Baz.cs
However, I get an HTTP 404.7 error that says "The request filtering module is configured to deny the file extension." I can remove the file extension from request filtering by modifying web.config, but I don't want my source code to be viewable. How should I set this up?
Upvotes: 3
Views: 789
Reputation: 5468
If the paths to the files don't match with the urls you want to have than you can do the following:
mark the folder where you keep your source files as denied for everyone in the web.config (example for the /SourceCode dir)
allow the .cs extension in the request filtering module
Upvotes: 0
Reputation: 24125
The only way you might have possibility to get it working is through relaxedUrlToFileSystemMapping setting in ASP.NET 4.0. You can read more here:
Upvotes: 1