<-
Apache > HTTP Server > Documentation > Version 2.4 > How-To / Tutorials

����ġ ���丮��: .htaccess ����

������ ���:  en  |  es  |  fr  |  ja  |  ko  |  pt-br 

�� ������ �ֽ��� ������ �ƴմϴ�. �ֱٿ� ����� ������ ���� ������ �����ϼ���.

.htaccess ������ ����Ͽ� ���丮���� ������ ������ �� �ִ�.

Support Apache!

����

top

.htaccess ����

top

�����̸�/��� ����ϴ°�

.htaccess ����(Ȥ�� "�л� ��������")�� ����ϸ� ���丮���� ������ ������ �� �ִ�. ���� ���� ���þ �ִ� ������ Ư�� ���� ���丮�� �θ�, �� ���丮�� ��� �������丮�� ���þ �����Ѵ�.

����:

.htaccess ���ϸ��� �ٸ��� ����ϰ� �ʹٸ�, AccessFileName ���þ ����Ͽ� ������ �� �ִ�. ���� ���, .config ���ϸ��� ����Ϸ��� ���� �������Ͽ� ������ ���� �߰��Ѵ�.

AccessFileName .config

�Ϲ������� .htaccess ������ �ּ��������� ������ ����. AllowOverride ���þ �� ���Ͽ� ���� �� �ִ� ������ �����Ѵ�. �� ���þ�� .htaccess ���Ͽ��� ����ϴ� ���þ� �з��� �����Ѵ�. ���þ .htaccess ���Ͽ��� ����� �� �ִٸ�, �ش� ���þ� ������ Override �׸��� ���þ ����ϱ����� AllowOverride�� ����� ���� �˷��ش�.

���� ���, AddDefaultCharset ���þ� ������ ���� �� ���þ .htaccess ���Ͽ��� ����� �� �ִ�. (���þ� ��࿡�� ������ �׸��� ����.) Override �ٿ� FileInfo�� �ִ�. �׷��� �� ���þ .htaccess ���Ͽ��� ����ϱ����ؼ��� �ּ��� AllowOverride FileInfo�� �ʿ��ϴ�.

����:

������: �ּ�������, ����ȣ��Ʈ, directory, .htaccess
Override: FileInfo

Ư�� ���þ .htaccess ���Ͽ��� ����� �� �ִ��� �ñ��ϸ� ���þ� ������ ������ �׸� ".htaccess"�� �ִ��� Ȯ���Ѵ�.

top

���� .htaccess ������ ����ϳ� (Ȥ�� ������� �ʳ�)

�Ϲ������� �ּ������Ͽ� ������ �� ���� ��찡 �ƴ϶�� .htaccess ������ ����ϸ� �ȵȴ�. ���� ���, ����� ������ �׻� .htaccess ���Ͽ� �־�� �Ѵٴ� ���� �߸� �˷��� ���ش�. �̴� ����� �ƴϴ�. �ּ��������� ����� ���� ������ ���� �� �ְ�, ��� �̷��� ���Ѵ�.

.htaccess ������ ������ �����ڰ� ���丮���� ���� ������ �ٸ����ϰ� ������ ���� �ý��ۿ� root ������ ���� ��쿡 ����Ѵ�. ���� �����ڰ� ������ ���� �����ϰ� ���� ���� ��� �Ϲ� ����ڰ� ���� .htaccess ������ �����ϵ��� ����ϴ� ���� �ٶ����ϴ�. ���� ���, �� ��ǻ�Ϳ� ���� ����� ����Ʈ�� �����ϴ� ISP���� ����ڰ� �ڽ��� ������ �����ϰ� ���� ��찡 �׷��ϴ�.

�׷��� �Ϲ������� .htaccess ������ ������ ���ؾ� �Ѵ�. .htaccess ���Ͽ��� ����ϴ� ���þ�� �ּ��������� <Directory> ���ǰ� ���� ȿ���� �ִ�.

���� �ΰ��� ū ���������� .htaccess ���� ����� ���ؾ� �Ѵ�.

ù��°�� �����̴�. AllowOverride�� .htaccess ������ ����ϵ��� ����ϸ�, ����ġ�� ���丮���� .htaccess ������ ã�´�. �׷��� .htaccess ������ ����ϸ� ������ ������ ������� �ʴ� ��쿡�� ������ ��������! ��, .htaccess ������ ������ ��û�Ҷ����� �о���δ�.

�Դٰ� �����ؾ� �ϴ� ��ü ���þ ���������� ����ġ�� ��� ���� ���丮���� .htaccess ������ ã�´�. (��� ���þ �����ϳ� ���� ����.) �׷��� /www/htdocs/example ���丮�� �ִ� ������ ��û�ϸ�, ����ġ�� ���� ���ϵ��� ã�ƾ� �Ѵ�.

/.htaccess
/www/.htaccess
/www/htdocs/.htaccess
/www/htdocs/example/.htaccess

�׷��� �� ���丮�� �ִ� ������ ������ ������ ���������� ���� ��� ���Ͻý����� 4�� �� �����ؾ� �Ѵ�. (/������ .htaccess ������ ����� ��츦 ���Ѵ�. ������ ������� �ʴ´�.)

�ι�° ������ �����̴�. ����ڿ��� �������� ���� ������ �ָ� ����� ������ �� ���� ��ȭ�� �Ͼ �� �ִ�. ����ڿ��� �̷� ������ ���� ������ �����϶�. ��, ����ڰ� ���ϴ� �ͺ��� ���� ������ �ָ� ���������û�� ���´�. ����ڿ��� ������ ���� ������ ��Ȯ�� �˷���. ����ڿ��� AllowOverride�� ��� �����Ͽ����� ��Ȯ�� �˸��� ���� ������ �����ϸ� ������ ȥ���� ���� �� �ִ�.

���þ /www/htdocs/example ���丮�� .htaccess ������ �δ� �Ͱ� �ּ��������� <Directory /www/htdocs/example> Directory ������ �δ� ���� ������ ����.

/www/htdocs/example�� �ִ� .htaccess ����:

/www/htdocs/example�� �ִ� .htaccess ���� ����

AddType text/example .exm

apache2.conf ���Ͽ� �ִ� ����

<Directory /www/htdocs/example>
AddType text/example .exm
</Directory>

�׷��� ������ ��û�� ������ ������ �����ʰ� ����ġ�� �����Ҷ� �ѹ��� ������ �б⶧���� ���� ������ �����������Ͽ� ����ϸ� ������ �� ������.

AllowOverride ���þ none���� �����ϸ� .htaccess ������ ������ ����� �� ����.

AllowOverride None

top

��� ���þ �����ϳ�

.htaccess ������ �߰��� ���丮�� �� ���丮�� ��� �������丮�� .htaccess ���Ͽ� �ִ� ���� ���þ �����Ѵ�. �׷��� �������丮�� .htaccess ������ �����ؾ� �Ѵ�. �߰��� ������ ���þ �����Ѵ�. Ư�� ���丮�� �ִ� .htaccess ������ �������丮�� �ִ� .htaccess ������ ���þ ��ȿ�� ���� �� �ְ�, �������丮�� �ִ� ���þ�� �� �������丮 Ȥ�� �ּ������Ͽ� �ִ� ���þ ��ȿ�� ���� �� �ִ�.

����:

/www/htdocs/example1 ���丮�� ������ ���� .htaccess ������ �ִ�.

Options +ExecCGI

(����: .htaccess ���Ͽ� "Options" ���þ ����Ϸ��� "AllowOverride Options"�� �ʿ��ϴ�.)

/www/htdocs/example1/example2 ���丮���� ������ ���� .htaccess ������ �ִ�.

Options Includes

�� �ι�° .htaccess ������ Options Includes�� ���� ������ ������ ��ȿ�� ����⶧���� /www/htdocs/example1/example2 ���丮�� CGI ������ ������� �ʴ´�.

top

���� ����

���� ����� �˱����� �ٷ� �̰����� �д´ٸ� ������ ���� �ִ�. ��ȣ ������ �Ϸ��� .htaccess ������ �ʿ��ϴٴ� ���ذ� �θ� �����ִ�. �̴� ����� �ƴϴ�. �ּ��������� <Directory> ���ǿ� ���� ���þ �δ� ���� �� �����ϴ� ����̰�, ������ �ּ��������� ������ �� ���� ��쿡�� .htaccess ������ ����ؾ� �Ѵ�. ���� .htaccess ������ ����ؾ� �ϴ����� ������� ���ƾ� �ϴ����� ������ �����Ͽ���.

�տ��� �������� ������ .htaccess ������ �ʿ��ϴٰ� �����Ǹ� �Ʒ� ������ ������ �� ���̴�.

.htaccess ���� ����.

AuthType Basic
AuthName "Password Required"
AuthUserFile /www/passwords/password.file
AuthGroupFile /www/passwords/group.file
Require Group admins

�� ���þ �����ϱ����ؼ��� AllowOverride AuthConfig ���þ �ʿ����� �����϶�.

������ ���Ѻο��� ���� �ڼ��� ������ ���� ���丮���� ���� �ٶ���.

top

Server Side Includes ����

�Ǵٸ� �Ϲ����� .htaccess ������ �뵵�� Ư�� ���丮���� Server Side Includes�� �����ϰ� ����� ���̴�. ���ϴ� ���丮�� .htaccess ���Ͽ� ������ ���� ���� ���þ ����ϸ� �ȴ�.

Options +Includes
AddType text/html shtml
AddHandler server-parsed shtml

�� ���þ �����Ϸ��� AllowOverride Options�� AllowOverride FileInfo�� ��� �ʿ����� �����϶�.

server-side includes�� ���� �ڼ��� ������ SSI ���丮���� ���� �ٶ���.

top

CGI ����

���������� .htaccess ������ ����Ͽ� Ư�� ���丮���� CGI ���α׷� ������ ����ϰ� �ʹٸ�, ������ ���� ������ ����Ѵ�.

Options +ExecCGI
AddHandler cgi-script cgi pl

Ȥ�� �� ���丮�� �ִ� ��� ������ CGI ���α׷����� ó���ϰ� �ʹٸ� ������ ���� ������ �����ϴ�.

Options +ExecCGI
SetHandler cgi-script

�� ���þ �����Ϸ��� AllowOverride Options�� AllowOverride FileInfo�� ��� �ʿ����� �����϶�.

CGI ���α׷��ְ� ������ ���� �ڼ��� ������ CGI ���丮���� ���� �ٶ���.

top

�����ذ�

.htaccess ���Ͽ� �� ���� ���þ ���ϴ� ����� ���� �ʴ� ��� �������� ������ ���� �� �ִ�.

���� �Ϲ����� ������ ���� ���þ �����ϰ� ����� AllowOverride�� �������� ���� ����. ������ �Ǵ� ���� ������ AllowOverride None�� ������ Ȯ���Ѵ�. .htaccess ������ �ƹ����Գ� ���� ���� �������� �ٽ� �����Ͽ� ���� �˻��غ� �� �ִ�. ���� ������ ������ ������ ���� Ȯ���� AllowOverride None�� ����� ����.

�ݴ�� ������ �����Ҷ� ���� ������ �߻��ϸ� ����ġ �����α׸� �������. �Ƹ��� .htaccess ���Ͽ� �ִ� ���þ ������� �ʴ´ٰ� �� ���̴�. �ƴϰ� ���� ������ �ִٸ� ������ ��ģ��.

������ ���:  en  |  es  |  fr  |  ja  |  ko  |  pt-br 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.