Share via


Static Content <staticContent>

개요

요소는 <staticContent> IIS(인터넷 정보 서비스) 7에서 정적 파일에 대한 요청 처리와 관련된 여러 설정을 구성합니다.

<staticContent> 요소에는 IIS 7이 정적 파일에 문서 바닥글을 적용해야 하는지 여부를 지정하는 다음 세 가지 특성이 포함되어 있습니다.

  • enableDocFooter 특성은 문서 바닥글을 사용할 수 있는지 여부를 지정합니다.

  • defaultDocFooter 특성에는 다음 중 하나가 포함됩니다.

    • isDocFooterFileName 특성이 false로 설정된 경우 IIS 7에서 문서 바닥글에 사용할 텍스트 문자열입니다.
    • isDocFooterFileName 특성이 true로 설정된 경우 IIS 7이 문서 바닥글에 사용할 텍스트가 포함된 파일의 정규화된 경로입니다.
  • 위에서 설명한 대로 isDocFooterFileName 특성은defaultDocFooter 특성에 IIS 7이 문서 바닥글에 사용할 텍스트 문자열 또는 IIS 7이 문서 바닥글에 사용할 텍스트가 포함된 파일의 정규화된 경로가 포함되어 있는지 여부를 지정합니다.

참고

기본적으로 isDocFooterFileName 특성은 false 로 설정되고 전역적으로 잠깁니다. 문서 바닥글에 파일을 사용하려면 전역 수준에서 isDocFooterFileName 특성을 true 로 설정하거나 특성의 잠금을 해제해야 합니다. 특성 잠금 및 잠금 해제에 대한 자세한 내용은 IIS 7.0 구성 연습에서 잠금을 사용하는 방법을 참조하세요.

호환성

버전 참고
IIS 10.0 <staticContent> 요소가 IIS 10.0에서 수정되지 않았습니다.
IIS 8.5 <staticContent> 요소가 IIS 8.5에서 수정되지 않았습니다.
IIS 8.0 <staticContent> 요소가 IIS 8.0에서 수정되지 않았습니다.
IIS 7.5 <staticContent> 요소가 IIS 7.5에서 수정되지 않았습니다.
IIS 7.0 요소는 <staticContent> IIS 7.0에서 도입되었습니다.
IIS 6.0 요소는 <staticContent> 다음 IIS 6.0 메타베이스 속성을 대체합니다.
  • DefaultDocFooter
  • EnableDocFooter

설치 프로그램

요소는 <staticContent> IIS 7의 기본 설치에 포함됩니다.

방법

IIS 7에 대한 요소를 구성하기 <staticContent> 위한 사용자 인터페이스가 없습니다. 요소를 프로그래밍 방식으로 구성하는 <staticContent> 방법에 대한 예제는 이 문서의 코드 샘플 섹션을 참조하세요.

구성

특성

attribute Description
defaultDocFooter 선택적 문자열 특성입니다.

사이트의 모든 웹 페이지에 대한 기본 바닥글 텍스트 또는 기본 바닥글 텍스트가 포함된 파일의 경로를 지정합니다. IIS 7에서 이 속성을 사용하는 방법은 isDocFooterFileName 특성의 값에 따라 달라집니다.

참고: 사용자 지정 바닥글은 enableDocFooter 특성이 true로 설정된 경우에만 전송됩니다.
enableDocFooter 선택적 부울 특성입니다.

defaultDocFooter 특성으로 표시된 텍스트가 웹 사이트의 모든 정적 페이지에 표시되는지 여부를 지정합니다.

기본값은 false입니다.
isDocFooterFileName 선택적 부울 특성입니다.

defaultDocFooter 특성의 문자열에 사이트의 모든 정적 웹 페이지에 대한 기본 바닥글 텍스트가 포함된 파일의 경로가 포함되어 있는지 여부를 지정합니다.

기본값은 false입니다.

자식 요소

요소 Description
clientCache 선택적 요소입니다.

클라이언트로 전송되는 정적 콘텐츠를 캐싱하기 위한 설정을 지정합니다.
mimeMap 선택적 요소입니다.

MIME 매핑에 대한 파일 이름 확장명 목록을 지정합니다.

구성 샘플

다음 구성 샘플에서는 정적 콘텐츠에 대해 문서 바닥글을 사용하도록 설정하고 간단한 저작권 알림을 바닥글 텍스트로 추가합니다.

<configuration>
   <system.webServer>
      <staticContent enableDocFooter="true"
         defaultDocFooter="The information in this web site is copyrighted." />
   </system.webServer>
</configuration>

샘플 코드

다음 코드 샘플은 정적 콘텐츠에 대한 문서 바닥글을 사용하도록 설정하고 간단한 저작권 알림을 바닥글 텍스트로 추가합니다.

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/staticContent /enableDocFooter:"True"

appcmd.exe set config "Default Web Site" -section:system.webServer/staticContent /defaultDocFooter:"The information in this web site is copyrighted."

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetWebConfiguration("Default Web Site");

         ConfigurationSection staticContentSection = config.GetSection("system.webServer/staticContent");
         staticContentSection["defaultDocFooter"] = @"The information in this web site is copyrighted.";
         staticContentSection["enableDocFooter"] = true;

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample

   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetWebConfiguration("Default Web Site")

      Dim staticContentSection As ConfigurationSection = config.GetSection("system.webServer/staticContent")
      staticContentSection("defaultDocFooter") = "The information in this web site is copyrighted."
      staticContentSection("enableDocFooter") = True

      serverManager.CommitChanges()
   End Sub

End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site";

var staticContentSection = adminManager.GetAdminSection("system.webServer/staticContent", "MACHINE/WEBROOT/APPHOST/Default Web Site");
staticContentSection.Properties.Item("defaultDocFooter").Value = "The information in this web site is copyrighted.";
staticContentSection.Properties.Item("enableDocFooter").Value = true;

adminManager.CommitChanges();

VBScript

Set adminManager = WScript.CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST/Default Web Site"

Set staticContentSection = adminManager.GetAdminSection("system.webServer/staticContent", "MACHINE/WEBROOT/APPHOST/Default Web Site")
staticContentSection.Properties.Item("defaultDocFooter").Value = "The information in this web site is copyrighted."
staticContentSection.Properties.Item("enableDocFooter").Value = True

adminManager.CommitChanges()