Apache HTTP Server Version 2.2
This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.
You may follow this link to go to the current version of this document.
설명: | "마지막 슬래쉬" 리다이렉션을 제공하고 디렉토리 index 파일을 서비스한다 |
---|---|
상태: | Base |
모듈명: | dir_module |
소스파일: | mod_dir.c |
디렉토리의 index는 다음 둘중 한가지 방법으로 제공된다:
index.html
이라는
파일. DirectoryIndex
지시어는 이 파일의 이름을 지정한다. mod_dir
가
이 지시어를 제공한다.mod_autoindex
가
이 기능을 제공한다.두 기능은 서로 별개로 원한다면 자동 index 생성을 완전히 없앨 (혹은 교체할) 수 있다.
dirname
이 디렉토리라면 서버는 URL
http://servername/foo/dirname
요청을 받으면
"마지막 슬래쉬" 리다이렉션을 보낸다. 디렉토리에는 마지막
슬래쉬가 필요하다. 그래서 mod_dir
은
http://servername/foo/dirname/
로 리다이렉션을
보낸다.
설명: | 클라이언트가 디렉토리를 요청할때 찾아볼 자원 목록 |
---|---|
문법: | DirectoryIndex
local-url [local-url] ... |
기본값: | DirectoryIndex index.html |
사용장소: | 주서버설정, 가상호스트, directory, .htaccess |
Override 옵션: | Indexes |
상태: | Base |
모듈: | mod_dir |
DirectoryIndex
지시어는 클라이언트가
디렉토리명 끝에 /를 붙여서 디렉토리의 index를 요청할때 찾아볼
자원 목록을 지정한다. Local-url은 요청한 디렉토리에
상대적인 문서의 (%로 인코딩된) URL이다. 보통은 디렉토리에
있는 파일명이다. 여러 URL을 지정할 수 있고, 이 경우 서버는
첫번째로 찾은 파일을 보낸다. 자원을 찾을 수 없고
Indexes
옵션을 설정하였다면 서버는 직접 디렉토리
목록을 만든다.
DirectoryIndex index.html
이 경우 http://myserver/docs/
를 요청할때
http://myserver/docs/index.html
이 있으면 이를
보내고, 없다면 디렉토리 목록을 보낸다.
문서가 반드시 디렉토리에 상대적일 필요는 없다.
DirectoryIndex index.html index.txt /cgi-bin/index.pl
이 경우 디렉토리에 index.html
이나
index.txt
가 없으면 CGI 스크립트
/cgi-bin/index.pl
을 실행한다.
설명: | 마지막 슬래쉬 리다이렉션을 키고 끈다 |
---|---|
문법: | DirectorySlash On|Off |
기본값: | DirectorySlash On |
사용장소: | 주서버설정, 가상호스트, directory, .htaccess |
Override 옵션: | Indexes |
상태: | Base |
모듈: | mod_dir |
지원: | 아파치 2.0.51 이후부터 |
DirectorySlash
지시어는
mod_dir
가 디렉토리를 가리키는 URL을 수정할지
여부를 결정한다.
사용자가 마지막 슬래쉬없이 디렉토리에 해당하는 자원을
요청하면, mod_dir
는 보통 다음과 같은 이유로
사용자를 마지막 슬래쉬를 붙인 동일한 자원으로
리다이렉션한다.
mod_autoindex
가 올바로 동작한다. 이
기능이 없다면 이 모듈은 링크에 잘못된 경로를 쓰게 된다.DirectoryIndex
는
마지막 슬래쉬가 있는 디렉토리 요청만을 처리한다.그런데 이 기능을 원하지 않거나 위에 든 이유가 당신에게 알맞지 않다면 다음과 같이 리다이렉션을 하지 않을 수 있다.
# 아래 보안 경고 참고!
<Location /some/path>
DirectorySlash Off
SetHandler some-handler
</Location>
마지막 슬래쉬 리다이렉션을 끄면 정보가 유출될 수 있다.
(Options +Indexes
) mod_autoindex
를
사용하고 DirectoryIndex
를
(index.html
같은) 유효한 자원으로 설정하였지만
해당 URL에 다른 특별한 핸들러가 없는 상황을 상상해보라.
이 경우 마지막 슬래쉬가 있는 요청은 index.html
파일을 보여준다. 그러나 마지막 슬래쉬가 없는 요청은
디렉토리 내용을 보여준다.
설명: | Define a default URL for requests that don't map to a file |
---|---|
문법: | FallbackResource disabled | local-url |
기본값: | None - httpd will return 404 (Not Found) |
사용장소: | 주서버설정, 가상호스트, directory, .htaccess |
Override 옵션: | Indexes |
상태: | Base |
모듈: | mod_dir |
지원: | Apache HTTP Server 2.2.16 and later - The disabled argument
is supported since 2.2.24 |
The documentation for this directive has not been translated yet. Please have a look at the English version.