<-
Apache > HTTP Server > Documentation > Version 2.4

URL�� ���Ͻý��� ��ġ�� �����ϱ�

������ ���:  en  |  fr  |  ja  |  ko  |  tr 

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

�� ������ ��û�� URL�� ������ ����ġ�� ��� ������ ������ ���Ͻý��ۻ� ��ġ�� ã���� �����Ѵ�.

Support Apache!

����

top

���õ� ���� ���þ��

top

DocumentRoot

��û�� ���� ����ġ�� � ������ �������� �����ϱ����� �⺻������ ��û�� URL-���(URL���� ȣ��Ʈ���� ��Ʈ �ڿ� ������ �κ�)�� �������Ͽ��� ������ DocumentRoot �ڿ� ���δ�. �׷��� DocumentRoot �Ʒ��ִ� ���ϰ� ���丮���� ������ ���Ե� �⺻���� �����̴�.

top

DocumentRoot �ۿ� �ִ� ���ϵ�

���� ���Ͻý��ۿ��� DocumentRoot �Ʒ� �������� �κ��� ������ ������ �ʿ䰡 �ִ�. ����ġ�� �� ��� �������� ����� ����� �� �ִ�. ���н� �ý��ۿ��� �ɺ���ũ�� ����Ͽ� ���Ͻý����� �ٸ� �κ��� DocumentRoot �Ʒ��� �� �� �ִ�. ������ ���� ����ġ�� �ش� ���丮�� Options ������ FollowSymLinks�� SymLinksIfOwnerMatch�� �ִ� ��쿡�� �ɺ���ũ�� ���󰣴�.

��, Alias ���þ�� ���Ͻý����� Ư�� �κ��� �������� �����Ѵ�. ���� ��� ������ ���ٸ�

Alias /docs /var/web

URL http://www.example.com/docs/dir/file.html�� /var/web/dir/file.html�� ������ �����Ѵ�. ������ ��ο� �ִ� ��� ������ CGI ��ũ��Ʈ�� ����ϴ� ���� �����ϰ��� ScriptAlias ���þ ���� ���� �Ѵ�.

AliasMatch�� ScriptAliasMatch ���þ��� ������ ����ǥ���ı�� ������ ��ġ�� ����Ͽ� �� ������ ������ �����ϴ�. ���� ���,

ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) /home/$1/cgi-bin/$2

�� http://example.com/~user/cgi-bin/script.cgi���� ��û�� ��� /home/user/cgi-bin/script.cgi�� �����ϰ�, �ش� ������ CGI ��ũ��Ʈ�� ����Ѵ�.

top

����� ���丮

���н� �ý����� ���������� Ư�� ����� user�� Ȩ���丮�� ~user/�� ��Ī�Ѵ�. mod_userdir ����� �� ������ �������� Ȯ���Ͽ�, ������ ���� URL�� ������ �� ����� Ȩ���丮 �ȿ� �ִ� ������ �����Ѵ�.

http://www.example.com/~user/file.html

���Ȼ� ������ ����� Ȩ���丮�� ���� ������ �� ������ �ȵȴ�. �׷��� UserDir ���þ�� ����� Ȩ���丮���� ���� ���ϵ��� ���� ���丮�� �����Ѵ�. �⺻ ���� Userdir public_html�� ����ϰ� /home/user/�� /etc/passwd�� ������ ����� Ȩ���丮���, ���� URL�� ���� /home/user/public_html/file.html�� �����Ѵ�.

��, Userdir ���þ�� /etc/passwd�� Ȩ���丮�� ��ġ�� ��������ʴ� �ý����� ���� ���� �ٸ� ���¸� ����� �� �ִ�.

� ����� (���� ������ %7e�� ���ڵ��Ǵ�) "~" ��ȣ�� �̻��Ͽ� �ٸ� ������� ����� ���丮�� ��Ÿ���� �;��Ѵ�. �� ����� mod_userdir�� ���������ʴ´�. �׷��� ����� Ȩ���丮�� ��Ģ���� ������� �������ִٸ�, AliasMatch ���þ ����Ͽ� ���ϴ� ȿ���� ���� �� �ִ�. ���� ���, ������ AliasMatch ���þ ����ϸ� http://www.example.com/upages/user/file.html�� /home/user/public_html/file.html�� �����Ѵ�:

AliasMatch ^/upages/([a-zA-Z0-9]+)/?(.*) /home/$1/public_html/$2

top

URL �����̷���(Redirection)

�տ��� ������ ���� ���þ���� ����ġ�� ���Ͻý����� Ư�� ��ҿ� �ִ� ������ Ŭ���̾�Ʈ���� ������ �����. �׷��� ������ ��û�� ������ �ٸ� URL�� �ִٰ� Ŭ���̾�Ʈ���� �˷��־�, Ŭ���̾�Ʈ�� ���� �� URL�� ��û�ϵ��� ����� ���� ���� ���� �ִ�. �̸� �����̷���(redirection)�̶�� �ϸ�, Redirect ���þ ����Ѵ�. ���� ���, DocumentRoot �Ʒ� /foo/ ���丮�� ������ ���� /bar/ ���丮�� �Ű�ٸ� ������ ���� Ŭ���̾�Ʈ�� ���ο� ��ġ�� ��û�ϵ��� �Ѵ�:

Redirect permanent /foo/ http://www.example.com/bar/

�׷��� www.example.com ������ /foo/�� �����ϴ� URL-��δ� /foo/�� /bar/�� �ٲ� URL�� �����̷��ǵȴ�. Ŭ���̾�Ʈ�� ���� �����ܿ� � �ٸ� �����ε� �����̷����� �� �ִ�.

��, ����ġ�� �� ������ ���ۼ� ������ ���� RedirectMatch ���þ �����Ѵ�. ���� ���, �ٸ� ��û�� �״�� �ΰ� ����Ʈ Ȩ�������� ���� ��û���� �ٸ� ����Ʈ�� �����̷����Ϸ���:

RedirectMatch permanent ^/$ http://www.example.com/startpage.html

�ӽ÷� ����Ʈ�� ��� �������� �ٸ� ����Ʈ�� Ư�� �������� �����̷����Ϸ���:

RedirectMatch temp .* http://othersite.example.com/startpage.html

top

�����Ͻ�(Reverse Proxy)

����ġ�� �ٸ� ������ �ִ� ������ ������ URL �������� ������ �� �ִ�. �� ��� �������� ���� �������� ������ �����ͼ� Ŭ���̾�Ʈ���� �����ϴ� ���Ͻ� ������ ���� �����ϱ⶧���� �̷� ����� �����Ͻ�(reverse proxying)��� �Ѵ�. Ŭ���̾�Ʈ�� ���忡�� �����Ͻ� ������ ������ �����ִ� ��ó�� ���̹Ƿ� �Ϲ� ���Ͻÿʹ� �ٸ���.

�Ʒ� �������� Ŭ���̾�Ʈ�� /foo/�� �ִ� ������ ��û�ϸ�, ������ internal.example.com�� /bar/ ���丮���� ������ �����ͼ� ������ ��ġ ������ �־��� ��ó�� Ŭ���̾�Ʈ���� ������.

ProxyPass /foo/ http://internal.example.com/bar/
ProxyPassReverse /foo/ http://internal.example.com/bar/

ProxyPass�� ������ ������ ������ ���������� �����ϸ�, ProxyPassReverse ���þ�� internal.example.com�� ������ �����̷����� ���ۼ��Ͽ� �����̷����� ���� ������ ������ ���丮�� ����Ű���� �Ѵ�. ��, ProxyPassReverseCookieDomain�� ProxyPassReverseCookieDomain�� ���� ������� ���� ������ ���� ��Ű�� ���ۼ��Ѵ�.

�׷��� ���� �ȿ� �ִ� ��ũ�� ���ۼ����� ������ �����϶�. internal.example.com�� ���� ���븵ũ�� Ŭ���̾�Ʈ�� ���Ͻü����� �ƴ϶� internal.example.com���� ���� ��û�ϰ� �Ѵ�. �����ڰ� ���� mod_proxy_html ����� ����Ͽ� HTML�� XHTML�� �ִ� ��ũ�� ���ۼ��� �� �ִ�.

top

���ۼ� ���� (Rewriting Engine)

�� ������ ġȯ�� �ʿ��Ҷ� mod_rewrite�� ���ۼ� ������ ������ �ȴ�. �� ����� ���þ�� ������ ������ Ŭ���̾�Ʈ�� IP �ּ� �� ��û�� Ư¡�� ������ ��� �ִ� ������ �������� ������ �� �ִ�. ��, mod_rewrite�� ��û�� ��� ó������ �����ϱ����� �ܺ� �����ͺ��̽� �����̳� ���α׷��� ����� �� �ִ�. ���ۼ� ������ ������ �ٷ� �� ���� ����, ��, ���� �����̷��� (alias), �ܺ� �����̷���, ���Ͻ�, ��θ� �����Ѵ�. mod_rewrite�� ����ϴ� ���� ���� URL ���ۼ� ��ħ������ �����Ѵ�.

top

File Not Found

�ᱹ ��û�� URL�� �����ϴ� ������ ���Ͻý��ۿ��� ã�� ���� ����̴�. ���� ���� ������ �ִ�. � ��� ������ �ٸ� ������ �Ű�� ������ �� �ִ�. �� ��� Ŭ���̾�Ʈ���� URL �����̷������� �ڿ��� ���ο� ��ġ�� �˷��ִ� ����� ���� ����. �׷��� �ڿ��� �Űܵ� ������ �ϸ�ũ�� ��ũ�� ��� ��ȿ�ϴ�.

"File Not Found" ������ �ٸ� �Ϲ����� ������ �������� ���� Ȥ�� HTML ��ũ�� URL�� �߸� �Էµ� ����̴�. ����ġ�� mod_speling (������� Ʋ���� �ʾ���) ���� �̿� ���� ������ ���´�. �� ����� ����ϸ� "File Not Found" ������ �߻��ϴ� ��� ����� ���ϸ��� ���� �ڿ��� ã�´�. ���� �߰��ϸ� mod_speling�� Ŭ���̾�Ʈ�� �ùٸ� ��ġ�� HTTP �����̷����Ѵ�. "�����" ������ ������ �ִٸ� Ŭ���̾�Ʈ���� ����� ������.

mod_speling�� Ư�� ������ ������ ��ҹ��ڸ� ���������ʰ� ���ϸ��� ���ϴ� ����̴�. �׷��� ���н� ���Ͻý��۰� URL�� ��ҹ��� ������ �������ϴ� ����ڰ� �ִ� �ý��ۿ� ������ �ȴ�. �׷��� mod_speling�� ���� URL�� ���ľ��Ѵٸ�, "�߸���" ��û������ URL �����̷��ǰ� Ŭ���̾�Ʈ�� ���ο� ��û�� �Ͼ�Ƿ� ������ �δ��� �ȴ�.

ã�� �õ��� ��� �����ϸ� ����ġ�� HTTP status code 404 (file not found) ������������ ������. �� �������� ������ ErrorDocument ���þ�� �����ϸ�, ��������� ���� ���� ������ �����Ͽ� ����������� �� �ִ�.

������ ���:  en  |  fr  |  ja  |  ko  |  tr 

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.