2014-10-20 92 views
1

我試圖創建一個站點地圖使用web.sitemap當試圖查看站點地圖我有404.7 server error我已經排序允許在web.config文件擴展名但現在我有問題允許查看文件類型。這個錯誤告訴我做到以下幾點:查看XML網站地圖IIS Express

To set a MIME type, run the following command in the IIS Express install directory: appcmd set  config /section:staticContent /+[fileExtension='string',mimeType='string'] 
The variable fileExtension string is the file name extension and the variable mimeType string is the file type description. 
For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain'] 

當我看我只看到XML配置文件的文件夾中。 有沒有辦法在web.config中添加MIME類型?還是我必須做IIS的東西?

我只允許文件類型:

<fileExtensions allowUnlisted="true"> 
     <remove fileExtension=".sitemap"/> 
     <add fileExtension=".sitemap" allowed="true"/> 
</fileExtensions> 

回答

0

您需要的MIME類型以及

<staticContent> 
    <mimeMap fileExtension=".sitemap" mimeType="application/xml" /> 
</staticContent>