How to remove extension from iis using web.config

This is my web.config and I want to change iis with it, but in localhost it crashes my site with 500 error.

<staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> 
+6
source share
2 answers

Buetto, just add this line to your web.config:

 <staticContent> **<remove fileExtension=".json" />** <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> 

This will change the iis configuration of your server (localhost).

+10
source

Without a description of the error you are getting, I can only assume that you are adding a mimetype that already exists on the IIS server.

In these cases, or where you are not sure, you can remove the extension before adding it to your configuration file.

 <staticContent> <remove fileExtension=".json" /> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> 
+1
source

All Articles