Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove an extension from iis using web.config

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

<staticContent>
  <mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
like image 973
Lucas Buetto Avatar asked Dec 18 '15 13:12

Lucas Buetto


2 Answers

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

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

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

like image 93
Renan Barreiro Avatar answered Nov 11 '22 11:11

Renan Barreiro


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

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

<staticContent>
  <remove fileExtension=".json" />
  <mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
like image 7
jpgrassi Avatar answered Nov 11 '22 13:11

jpgrassi