<-
Apache > HTTP Server > �ĵ� > �汾2.2 > ģ��
���� ��л | �������� | ��ƪ���ߣ��𲽹� | ��ҳ�����£�2006��1��25�� | ��ȡ���°汾

Apacheģ�� mod_dir

˵��ָ��Ŀ¼�����ļ��Լ�ΪĿ¼�ṩ"βб��"�ض���
״̬����(B)
ģ����dir_module
Դ�ļ�mod_dir.c

����

Ŀ¼������������������Դ��

�������������໥�����ģ������������ȫȥ�����滻�������Զ����ɡ�

��Ϊ��Ŀ¼��������Ҫ��һ��"/"��β�����Ե����������յ��� http://servername/foo/dirname ������ʱ����dirname��һ��Ŀ¼����mod_dir���Ὣ���ض��� http://servername/foo/dirname/ ��

top

DirectoryIndex ָ��

˵�����ͻ�������һ��Ŀ¼ʱѰ�ҵ���Դ�б�
�﷨DirectoryIndex local-url [local-url] ...
Ĭ��ֵDirectoryIndex index.html
������server config, virtual host, directory, .htaccess
������Indexes
״̬����(B)
ģ��mod_dir

DirectoryIndexָ�������˵��ͻ����������Ŀ¼����ĩβ�������һ��"/"�Ա�ʾ�����Ŀ¼������ʱ����������ҪѰ�ҵ���Դ�б�Local-url(%�ѽ����)��һ������ڱ�����Ŀ¼���ĵ���URL(ͨ�����Ǹ�Ŀ¼�е�һ���ļ�)������ָ�����URL�������������������ҵ�����һ������һ��Ҳû���ҵ��������Ǹ�Ŀ¼������Indexesѡ������������Զ�����һ���Ǹ�Ŀ¼�е���Դ�б�

ʾ��

DirectoryIndex index.html

��������ָʾ�� http://myserver/docs/ �����󷵻� http://myserver/docs/index.html(������)���򷵻ظ�Ŀ¼��������Դ���б�

ע�⣬ָ�����ĵ���һ������λ�ڱ������Ŀ¼�£�Ҳ����ָ��һ������URL��ָ������λ�ã�

DirectoryIndex index.html index.txt /cgi-bin/index.pl

���������ý�������index.html��index.txt�������ڵ������ִ��CGI�ű�/cgi-bin/index.pl ��

top

DirectorySlash ָ��

˵���򿪻�ر�Ŀ¼��βб��(/)�Զ���ȫ����
�﷨DirectorySlash On|Off
Ĭ��ֵDirectorySlash On
������server config, virtual host, directory, .htaccess
������Indexes
״̬����(B)
ģ��mod_dir
���������� Apache 2.0.51 ���Ժ�İ汾�п���

DirectorySlashָ�����mod_dir�Ƿ�ͨ���������URL��β����"/"ʹ���ض�������ָ���Ŀ¼��

���͵ģ�����û�����һ����βû��"/"����Դ�����Ҹ���Դָ��һ��Ŀ¼��mod_dir��ͨ���������URL��β����"/"ʹ���ض�������ָ���Ŀ¼��Ĭ�Ͽ����Զ���ȫ����������ԭ��

����㲻ϣ������Զ���ȫ������Ч���������ں�����ԭ������Թر�����

# ��μ�����İ�ȫ����
<Location /some/path>
DirectorySlash Off
SetHandler some-handler
</Location>

��ȫ����

�ر�Ŀ¼�Զ��ض�����ܻᵼ����Ϣй©������mod_autoindex������(Options +Indexes)����DirectoryIndexҲ��ȷ���õ�һ����Դ(���磺index.html)ͬʱû����������������URL���������ʱ����"/"��β��URL���õ�index.html�ļ���������"/"��β�����󽫵õ�Ŀ¼�б���