904N/A<?
xml version="1.0" encoding="EUC-KR" ?>
904N/A<!-- English Revision: 122770:420990 (outdated) --> 904N/A Licensed to the Apache Software Foundation (ASF) under one or more 904N/A contributor license agreements. See the NOTICE file distributed with 904N/A this work for additional information regarding copyright ownership. 904N/A The ASF licenses this file to You under the Apache License, Version 2.0 904N/A (the "License"); you may not use this file except in compliance with 904N/A the License. You may obtain a copy of the License at 904N/A Unless required by applicable law or agreed to in writing, software 904N/A distributed under the License is distributed on an "AS IS" BASIS, 904N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 904N/A See the License for the specific language governing permissions and 904N/A limitations under the License. 904N/A <
parentdocument href="./">Miscellaneous Documentation</
parentdocument>
904N/A <
title>URL ���ۼ� ��ħ��</
title>
904N/A <
cite>Ralf S. Engelschall <rse@apache.org></
cite><
br />
904N/A <
p>�� ������ <
module>mod_rewrite</
module> <
a 904N/A �� ������ �����ڰ� ���� �۾����� �ε�ġ�ԵǴ� ��������
904N/A URL��� ������ �ذ��ϱ����ؼ� ��� ����ġ
904N/A <
module>mod_rewrite</
module>�� ����ϴ��� �����Ѵ�. URL
904N/A ���ۼ� ��Ģ�� �����Ͽ� ������ �ذ��ϴ� ����� �ڼ��� �����Ѵ�.</
p>
<
title><
code>mod_rewrite</
code> �Ұ�</
title>
<
p>����ġ <
module>mod_rewrite</
module> ����� �����ϴ�.
��, URL�� ������ �� �ִ� �����ϰ� �Ƿ� ������ ����̴�.
����ؿԴ� ���� ��� ������ URL ������ �����ϴ�. ����
�� �밡�� ����ϱ� �����ϴ�. <
module>mod_rewrite</
module>��
�ִ� ������ �ʺ��ڰ� �����ϰ� ����ϱ� ���� �ʴٴ� ���̴�.
������ ����ġ ��� ���� <
module>mod_rewrite</
module>��
<
p>�ٸ� ����: <
module>mod_rewrite</
module>�� ���� �����
ó���� ���� �� ���� �ٽ� ������� �ʰų�, �����Կ� �ŷ�Ǿ�
������ �� ���� ��� ���� ���̴�. �� ���� ù��° ��츦
�������� �̹� �˷��� ��� �����ʸ� �Ұ��Ϸ��� �Ѵ�.</
p>
<
title>�ǿ����� �ذ�å</
title>
<
p>���� ���� ���� �����ų� �ٸ� ������� ���� ���� �ǿ�����
�ذ�å�� ���´�. �������� URL ���ۼ��� �渶���� ������ ����
<
note type="warning">����: ���� ������ ��� ��Ȳ�� �°�
������ ���� �����ؾ� �� ��찡 �ִ�. ���� ���, �߰���
<
module>mod_alias</
module>, <
module>mod_userdir</
module>
���� ����Ѵٸ� <
code>[PT]</
code> �÷��� �߰��Ѵ�. Ȥ��
�ּ�������/����ȣ��Ʈ �����Ұ� �ƴ� <
code>.htaccess</
code>
�����ҿ� �˸°� ��Ģ�� ������ ���� �ִ�. ����ϱ� ��
�� ��Ģ�� � ����� �ϴ��� �����ϵ��� �ض�. ���� ������
<
title>������ �Ǵ� URL</
title>
<
p>�� ���ҽ��� ���� ���� URL�� ������ �������� �ִ�.
���� (���� ����ϰ� �˷����� ��) ������ �Ǵ� URL��,
���� Ȥ�� ���� �뵵�� URL�� �ִ�. ����ڰ� ��û��
� URL�� ����ϴ��� ������ �Ǵ� URL���� �������
<
p>������ �����ʴ� ��� URL�� ������ �˵��� ��ġ������
�ܺ� HTTP �����̷����Ѵ�. ���� ��� �Ʒ� ��Ģ��
<
code>/~user</
code>�� ������ �Ǵ� <
code>/
u/
user</
code>��
��ü�ϰ�, <
code>/
u/
user</
code> �������� �������� ��ٸ�
RewriteRule ^/<
strong>~</
strong>([^/]+)/?(.*) /<
strong>u</
strong>/$1/$2 [<
strong>R</
strong>]
RewriteRule ^/([uge])/(<
strong>[^/]+</
strong>)$ /$1/$2<
strong>/</
strong> [<
strong>R</
strong>]
<
title>������ �Ǵ� ȣ��Ʈ��</
title>
RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
<
title><
code>DocumentRoot</
code>�� �ű� ���</
title>
module="core">DocumentRoot</
directive>�� ���� URL
"<
code>/</
code>"�� ���� ����ִ�. ���� �̰��� ���
�ڷᰡ ���� �ʰ�, �ڷᰡ �ٸ� ���� ���� ������ִ�
��찡 �ִ�. ���� ��� ��Ʈ��� ����Ʈ�� (�ܺθ� ����
Ȩ������) <
code>/
e/
www/</
code>�� (��Ʈ����� ����
Ȩ������) <
code>/
e/
sww/</
code>�� �ִٰ� ����. ����
<
directive module="core">DocumentRoot</
directive>��
<
code>/
e/
www/</
code>�̱����, ��û���� ��������
���Ե� �� ���� �̰����� �����;� �Ѵ�.</
p>
<
p>�츮�� URL <
code>/</
code>�� <
code>/
e/
www/</
code>��
�����̷��Ǹ� �ϸ� �ȴ�. ����� �������� ������
<
module>mod_rewrite</
module>�� ����ؼ��� �����ϴ�.
(<
module>mod_alias</
module> ���� �����ϴ�) URL
<
em>Alias</
em> ���� �������� ����� <
em>�պκ�</
em>��
��. <
directive module="core">DocumentRoot</
directive>��
��� URL�� �պκ��̱���� �� ����� ����Ͽ� �����̷�����
�� �� ���. <
module>mod_rewrite</
module>�� ����ϸ�
RewriteRule <
strong>^/$</
strong> /
e/
www/ [<
strong>R</
strong>]
<
title>������ ������ ����</
title>
<
p>���丮�� ��Ī�ϴ� URL�� ������ ������ ������
��ٸ� ��� �����ڴ� ȯȣ�� ���̴�. �������� ��ٸ�,
����ϸ� ������ <
code>foo</
code>��� <
em>����</
em>��
ã����� ���� ���Ѵ�. ������ ���丮�̱����
�Ƶ����� �ʴ´�. ��κ��� ��� ���� ������ �ڵ�����
URL�� ��ġ����, ���� ���� ����� �� ��찡 �ִ�. ����
���, CGI ��ũ��Ʈ ������ ������ URL ���ۼ��� �� �Ŀ�
<
p>�� �̹��� ������ �ذ����� ������ �ڵ����� ������
�������� �߰��ϴ� ���̴�. ������ ������ �� ����
�ùٷ� ��û�� �� �ֵ���, �ܺ� �����̷����� �ؾ� �Ѵ�.
���� �����̷����� �Ѵٸ� ���丮 ���������� �����Ͽ�
�� �������� ��� URL�� �����ϴ� ���� ������
��û�Ҷ� ã�� �� ���. ���� ���, �ܺ� �����̷�����
<
p>���� �̸� �ذ��ϱ����� ������ ���� �����Ѵ�:</
p>
RewriteRule ^foo<
strong>$</
strong> foo<
strong>/</
strong> [<
strong>R</
strong>]
<
p>Ȩ���丮�� �ֻ��� <
code>.htaccess</
code> ���Ͽ�
������ ���� ������ ���� �ִ�. ���� ó���ϴµ� �δ���
RewriteCond %{REQUEST_FILENAME} <
strong>-d</
strong>
RewriteRule ^(.+<
strong>[^/]</
strong>)$ $1<
strong>/</
strong> [R]
<
title>�ϰ�� URL ������ ���� ��Ŭ������</
title>
<
p>��Ʈ��� ���������� ��� �������� �����ϰ� �ϰ��
URL ������ ����� �ʹ�. ��, ��� (���ǻ� ������ ���Ͽ�
������ ��������!) URL�� ���� <
em>����������</
em> �����!
�� �̸��� ������������ ������ ������ �ο��ؾ� �Ѵ�:
URL�� ���� ������ ��Ī�ϸ� �ȵȴ�. �������� �ڵ�����
<
p>���� �����, ��, ����ü�� ��ġ ������ ������
(�л��) �ܺθʿ� ���� ���� ������ ���´�. �ܺθ���
���Ͽ� �����ߴ�. �������� ��� �������� URL�� ������
��ٸ� ������ ���� URL��,</
p>
<
p>������ ���� �����̷����Ѵ�</
p>
<
p>�Ʒ� ��Ģ�� �������� ����Ͽ� �� �۾��� �Ѵ� (server0��
�ʿ� ���� ��� ��� ����� �⺻������� �����Ѵ�):</
p>
RewriteRule ^/u/<
strong>([^/]+)</
strong>/?(.*) http://<
strong>${user-to-host:$1|server0}</
strong>/u/$1/$2
RewriteRule ^/g/<
strong>([^/]+)</
strong>/?(.*) http://<
strong>${group-to-host:$1|server0}</
strong>/g/$1/$2
RewriteRule ^/e/<
strong>([^/]+)</
strong>/?(.*) http://<
strong>${entity-to-host:$1|server0}</
strong>/e/$1/$2
RewriteRule ^/([uge])/([^/]+)/?$ /$1/$
2/
.www/
RewriteRule ^/([uge])/([^/]+)/([^.]+.+) /$1/$
2/
.www/$3\
<
title>Ȩ���丮�� �ٸ� �������� ����</
title>
<
p>���� �����ڴ� �������� ��� Ȩ���丮�� �ٸ�
�������� ������ ��� �ذ�å�� �����. �� �����
���� ������ ��ü�� ���ο� ������ �����ϴµ� �ð���
<
p><
module>mod_rewrite</
module>�� ����ϸ� �����ϴ�.
RewriteRule ^/~(.+) http://<
strong>newserver</
strong>/~$1 [R,L]
<
title>Ȩ���丮 ���� �����</
title>
<
p>����ڰ� ��õ���� ����Ʈ�� ���� Ȩ���丮 ������
�����. ��, ���� ��� �̸��� ����ڸ��� ù��° ������
�������丮�� Ȩ���丮�� �д�. ����,
<
p>����ǥ�ð� �ִ� URL�� ���� ���� ������ ��ȯ�ϱ�����
RewriteRule ^/~(<
strong>([a-z])</
strong>[a-z0-9]+)(.*) /home/<
strong>$2</
strong>/$
1/
.www$3
<
title>���Ͻý��� �籸��</
title>
<
p>�� ���� �Ƿ� �ϵ��ھ����̴�: ���丮��
<
code>RewriteRules</
code>�� �ſ� ���� ����Ͽ� �ڷ�
��ü�� �״�� ��ü�� ���� �ڷḦ �ڿ������� ����¡�ϵ���
�Ѵ�. ���: ���� 1992�� ���� �����Ӱ� ����� �� �ִ�
���н� ����Ʈ������� <
strong><
em>
net.sw</
em></
strong>��
��Ƶΰ� �־��. �̴� ���� ��ǻ�Ͱ����� ����ϸ鼭
�����ص��� �����ð��� �ý��� ���ڿ� ��Ʈ�� ���ڸ�
�ؿԱ���� �� ������� ���̴�. ���ָ��� ���� ����Ʈ���
�߰��� ������ ���丮�� ��� �����Դ�:</
p>
drwxrwxr-x 2 netsw users 512 Aug 3 18:39 Audio/
drwxrwxr-x 2 netsw users 512 Jul 9 14:37 Benchmark/
drwxrwxr-x 12 netsw users 512 Jul 9 00:34 Crypto/
drwxrwxr-x 5 netsw users 512 Jul 9 00:41 Database/
drwxrwxr-x 4 netsw users 512 Jul 30 19:25 Dicts/
drwxrwxr-x 10 netsw users 512 Jul 9 01:54 Graphic/
drwxrwxr-x 5 netsw users 512 Jul 9 01:58 Hackers/
drwxrwxr-x 8 netsw users 512 Jul 9 03:19 InfoSys/
drwxrwxr-x 3 netsw users 512 Jul 9 03:21 Math/
drwxrwxr-x 3 netsw users 512 Jul 9 03:24 Misc/
drwxrwxr-x 9 netsw users 512 Aug 1 16:33 Network/
drwxrwxr-x 2 netsw users 512 Jul 9 05:53 Office/
drwxrwxr-x 7 netsw users 512 Jul 9 09:24 SoftEng/
drwxrwxr-x 7 netsw users 512 Jul 9 12:17 System/
drwxrwxr-x 12 netsw users 512 Aug 3 20:15 Typesetting/
drwxrwxr-x 10 netsw users 512 Jul 9 14:08 X11/
<
p>1996�� 7�� �� ����Ҹ� ���ִ� �� �������̽��� ����
���� ���ϱ�� ������. "���ִ�"�� ����, �ֻ���
���丮�� CGI ��ũ��Ʈ�� ���� �ʰ?, ����� ����������
���� �������ϱ� �ٶ��ٴ� ���̴�. ��? ����Ҹ� ���߿�
FTP�ε� ������ �� �ֵ��� ���� �����̿������ ���̳�
CGI�� ��õ� ������ ���� �α� �Ⱦ��.</
p>
<
p>�ذ�å�� �� �κ����� ������: ���� ���丮 ���ؿ���
�ʿ��� ��� �������� �������� ����� CGI ��ũ��Ʈ��
�ʿ��ϴ�. ���� �� ��ũ��Ʈ���� ������ ����
-rw-r--r-- 1 netsw users 1318 Aug 1 18:10 .wwwacl
drwxr-xr-x 18 netsw users 512 Aug 5 15:51 DATA/
-rw-rw-rw- 1 netsw users 372982 Aug 5 16:35 LOGFILE
-rw-r--r-- 1 netsw users 659 Aug 4 09:27 TODO
drwxr-xr-x 2 netsw users 512 Jul 8 23:47 netsw-img/
<
p><
code>DATA/</
code> �������丮�� ������ ���� ����Ұ�
�ִ�. ���� <
strong><
em>
net.sw</
em></
strong>�� ������ ����
<
code>rdist</
code>�� ����Ͽ� �ڵ����� �����´�. �ι�°
�κ��� ���Ҵ�: ��� �� �� ������ �ϳ��� �ڿ�������
URL ������ �����ϴ°�? ����ڿ��� <
code>DATA/</
code>
���丮�� ���߰�, URL���� ������ CGI ��ũ��Ʈ�� �����ϰ�
�ʹ�. �ذ�å�� ������ ����: ���� ������ <
directive module="core">DocumentRoot</
directive>���� ���
URL <
code>/
net.sw/</
code>�� ���� ��� <
code>/
e/
netsw</
code>��
���ۼ��ϱ����� ���丮�� �������Ͽ� ������ ���� �����Ѵ�:</
p>
<
p>ù��° ��Ģ�� �������� �������� ��� ��û�� ���ؼ�
����ߴ�! �ι�° ��Ģ�� ���� �۾��� �Ѵ�. ���� ���丮��
Options ExecCGI FollowSymLinks Includes MultiViews
# �� ��� /
net.sw/ �� �����Ѵ�
# ������ ���丮�� �������� ��û�� ���
RewriteRule ^.+/(netsw-[^/]+/.+)$ $1 [L]
RewriteRule ^netsw-home\.cgi.* - [L]
RewriteRule ^netsw-changes\.cgi.* - [L]
RewriteRule ^netsw-search\.cgi.* - [L]
RewriteRule ^netsw-tree\.cgi$ - [L]
RewriteRule ^netsw-about\.html$ - [L]
RewriteRule ^netsw-img/.*$ - [L]
RewriteRule !^netsw-lsdir\.cgi.* - [C]
<
li>��° �κп��� ��ü �ʵ�('<
code>-</
code>')��
��� <
code>L</
code> (last) �÷��װ� ������ �ָ��϶�</
li>
<
li>������ �κп��� ù��° ��Ģ�� <
code>!</
code>
(not) ���ڿ� <
code>C</
code> (chain) �÷��� �ָ��϶�</
li>
<
li>������ ��Ģ���� ��Ÿ �ش����� �ʴ� ��� ��츦
��Ƴ��� ������ �ָ��϶�</
li>
<
title>NCSA imagemap�� ����ġ <
code>mod_imagemap</
code>����</
title>
<
p>������� NCSA ���������� �������� ����ġ ��������
�ڿ������� �Űܰ��� �ٶ���. ���� ������ NCSA
<
code>imagemap</
code> ����� ����� �������� ��������
����ġ <
module>mod_imagemap</
module>�� ó���ϱ� �ٶ���.
������ <
code>imagemap</
code> �����
���� �����ϴ� �����۸�ũ�� ���ٴ� ���̴�. ����ġ��
<
p>��� ��û���� �պκ��� �������� �����ϴ� �� ��Ģ��
<
title>���� ���丮���� ������ �˻�</
title>
<
p>���� �������� ���� ���丮���� ������ ã�ƾ� ��
���� �ִ�. �� ��� MultiViews�� �ٸ� ����� ������
<
p>���� ���丮���� ������ ã�� ��Ģ�� ���� ���α��Ѵ�.</
p>
# ���� custom/���� ã�� �õ��ϰ�...
RewriteCond /
your/
docroot/<
strong>dir1</
strong>/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /
your/
docroot/<
strong>dir1</
strong>/$1 [L]
# �ι�°�� pub/���� ã�� �õ��Ѵ�...
RewriteCond /
your/
docroot/<
strong>dir2</
strong>/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /
your/
docroot/<
strong>dir2</
strong>/$1 [L]
# ��ã���� �ٸ� Alias�� ScriptAlias ���þ� ������ �����Ѵ�.
<
title>URL�� ��� ȯ�溯���� �����Ѵ�</
title>
<
p>��û�鰣�� ���������� �����ϱ����� URL�� ������
���ڵ��ϴ� ��� �ִ�. ���� ���� �� ������ �����ϱ�����
��� �������� CGI wrapper�� ����ϰ� ���� �ʴ�.</
p>
<
p>���ۼ� ��Ģ�� ����Ͽ� ���������� �����ϰ�, ������
������ ���߿� XSSI�� CGI���� ����ϱ����� ȯ�溯����
�����Ѵ�. ���� URL <
code>/foo/S=
java/
bar/</
code>��
<
code>/
foo/
bar/</
code>�� ��ȯ�ǰ� <
code>STATUS</
code>���
ȯ�溯�� ���� "java"�� �����Ѵ�.</
p>
RewriteRule ^(.*)/<
strong>S=([^/]+)</
strong>/(.*) $1/$3 [E=<
strong>STATUS:$2</
strong>]
<
title>���� ����� ȣ��Ʈ</
title>
<
p>����ȣ��Ʈ�� ������� �ʰ� ���� ��ǻ�ͷ� DNS A
������� Ȩ�������� �����ϰ� �ʹ�.</
p>
<
p>
HTTP/
1.0 ��û�� ��� ����� ������, Host: HTTP
����� ������
HTTP/
1.1 ��û�� ���� ��Ģ�� ����Ͽ�
RewriteCond %{<
strong>HTTP_HOST</
strong>} ^www\.<
strong>[^.]+</
strong>\.host\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^www\.<
strong>([^.]+)</
strong>\.host\.com(.*) /home/<
strong>$1</
strong>$2
<
title>Ȩ���丮�� �ܺ� ������ �����̷���</
title>
������ Ȩ���丮 URL�� �ٸ� ������
�ٶ���. ���� ����ȣ��Ʈ �����ҿ��� ����Ѵ�.</
p>
<
p>���ۼ� ������ ����ϸ� �ȴ�:</
p>
RewriteCond %{REMOTE_HOST} <
strong>!^.+\.ourdomain\.com$</
strong>
<
title>������ URL�� �ٸ� �������� �����̷���</
title>
<
p>URL ���ۼ��� ���ؼ� ������ A�� �ش� ������ ���
��� ������ B�� ��û�� �����̷����ϴ� ����� ����
�����. ���� Perl�� �ۼ��� <
directive module="core">ErrorDocument</
directive> CGI ��ũ��Ʈ��
���������, <
module>mod_rewrite</
module>�� ����ϴ�
��� �ִ�. ���� ������ <
directive module="core">ErrorDocument</
directive> CGI ��ũ��Ʈ����
<
p>ù��° ����� ������ �������� �������� ��������
RewriteCond /
your/
docroot/%{REQUEST_FILENAME} <
strong>!-f</
strong>
RewriteRule ^(.+) http://<
strong>webserverB</
strong>.dom/$1
<
p>�� ����� ������ <
directive module="core">DocumentRoot</
directive> �ȿ� �ִ� ��������
�����ϴٴ� ���̴�. (���� ��� Ȩ���丮 ���� ����)
������ �߰��� �� ������, �� ���� ����� �ִ�:</
p>
RewriteCond %{REQUEST_URI} <
strong>!-U</
strong>
RewriteRule ^(.+) http://<
strong>webserverB</
strong>.dom/$1
<
p><
module>mod_rewrite</
module>�� URL �������(look-ahead)��
����Ѵ�. ���� ��� URL�� �����ϰ� �����ϴ�. ����
��� ��û���� ���� ������û�� �ѹ� �� �ϱ���� ������
���ɿ� �ǿ����� �ش�. ���� ������ CPU���� ��������
�����Ѵٸ� ����϶�. ��ǻ�Ͱ� �����ٸ� ù��° ����̳�
�� ���� <
directive module="core">ErrorDocument</
directive>
<
title>Ȯ�� �����̷���</
title>
<
p>���� �����̷����ϴ� URL�� �� ������ �ʿ䰡 �ִ�.
����ġ ���� URL escape �Լ��� "<
code>url#anchor</
code>"
���� URL�� anchor�� escape�Ѵ�. ����ġ��
<
code>uri_escape()</
code> �Լ��� �칰����(#)�� ����
escape�ϹǷ� ����� �� ���. ���� ��� �̷� URL��
<
p>���� �����̷����ϴ� NPH-CGI ��ũ��Ʈ�� ����� �ذ�å��
�ʿ��ϴ�. escape�� ���� �ʱ���̴� (NPH=non-parseable
headers). ���� ���� ���������� �Ͽ� (���ۼ� ��Ģ��
���κп� ����ؾ� �Ѵ�) ���ο� URL scheme
<
code>xredirect:</
code>�� �����Ѵ�:</
p>
<
p>���� <
code>xredirect:</
code>�� �����ϴ� ��� URL��
����� ������ ����:</
p>
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
$url = $ENV{'PATH_INFO'};
print "
HTTP/
1.0 302 Moved Temporarily\n";
print "Server: $ENV{'SERVER_SOFTWARE'}\n";
print "Location: $url\n";
print "<title>302 Moved Temporarily (EXTENDED)</title>\n";
print "<h1>Moved Temporarily (EXTENDED)</h1>\n";
print "The document has moved <a HREF=\"$url\">here</a>.<p>\n";
<
p>���� <
module>mod_rewrite</
module>�� ���� �������ϴ�
��� URL scheme���� �����̷����� �� �ִ�. ���� ���,
������ ���� <
code>news:newsgroup</
code>���� �����̷�����
RewriteRule ^anyurl xredirect:news:newsgroup
<
note>����: ���� Ư���� "���" ��Ģ�� ����Ͽ�
<
code>xredirect:</
code>�� �������� Ȯ���ؾ� �ϱ����
��Ģ�� <
code>[R]</
code>�̳� <
code>[R,L]</
code>�� ����ϸ�
<
title>����� ���� �߰�(multiplexer)</
title>
�ִ� ����� CPAN (Comprehensive Perl Archive Network)��
�ƴ°�? �� �ּҴ� ���迡 ����� ���� CPAN �̷� FTP
������ Ŭ���̾�Ʈ�� ������ �ִ� ������ �����̷����Ѵ�.
�̸� FTP ���� �߰� ����� �Ѵ�. CPAN�� CGI ��ũ��Ʈ��
���������, <
module>mod_rewrite</
module>�� ����Ͽ�
����ϰ� ���� �� ������?</
p>
<
p>���� <
module>mod_rewrite</
module> 3.0.0 �������
�����̷��ǿ� "<
code>ftp:</
code>" scheme�� ����� ��
�ִ�. �������� Ŭ���̾�Ʈ�� �ֻ��� �������� <
directive module="mod_rewrite">RewriteMap</
directive>�� ����
����Ͽ� ��ġ�� ������ �� �ִ�. ������ ���� ��Ģ����
�ֻ��� �������� �߰���� Ű�� ����Ѵ�.</
p>
RewriteRule ^/CxAN/(.*) %{REMOTE_HOST}::$1 [C]
RewriteRule ^.+\.<
strong>([a-zA-Z]+)</
strong>::(.*)$ ${multiplex:<
strong>$1</
strong>|
ftp.default.dom}$2 [R,L]
##
map.cxan -- Multiplexing Map for CxAN
<
title>�ð��� �� ���ۼ�</
title>
<
p>�ð��� ��� �ٸ� ������ �����ϴ� ��� ���� �����ڴ�
��� Ư���� �������� �����̷����ϱ����� CGI ��ũ��Ʈ��
����Ѵ�. <
module>mod_rewrite</
module>�δ� ���
<
p>���ۼ� ���ǿ��� ����� �� �ִ� ���� <
code>TIME_xxx</
code>
������ �ִ�. ������ Ư���� ����� ��
<
code><STRING</
code>, <
code>>STRING</
code>,
<
code>=STRING</
code>�� ����Ͽ� �ð��� ��� �����̷�����
RewriteCond %{TIME_HOUR}%{TIME_MIN} >0700
RewriteCond %{TIME_HOUR}%{TIME_MIN} <1900
������ �����ϰ�, ������ �ð� ����
����ϱ� ���� ����̴�...</
p>
<
title>YYYY�� XXXX�� ������ ��� ��ȣȯ</
title>
<
p>���� <
code>.html</
code> ������ <
code>.phtml</
code>��
compatibility) URL�� (���������� �����ϰ�) ���� ��
<
p>�̸��� �⺻�̸����� ���ۼ����� ���ο� Ȯ���ڸ�
���� ������ �ִ��� �˻��Ѵ�. �ִٸ� �� ���ϸ��� ����ϰ�,
������ URL�� �� ���·� ���ۼ��Ѵ�.</
p>
# ����.html �� ����.phtml ��
# �⺻�̸��� ã��, ã�Ҵٴ� ����� ����Ѵ�
RewriteRule ^(.*)\.html$ $1 [C,E=WasHTML:yes]
# ������ �ִٸ� ����.phtml �� ���ۼ��Ѵ�
RewriteCond %{REQUEST_FILENAME}.phtml -f
# �ƴϸ� �տ��� ã�� �⺻�̸��� �ǵ�����
RewriteCond %{ENV:WasHTML} ^yes$
<
title>������ �ٷ��</
title>
<
title>���� ���� (���߱�)</
title>
�����ϰ� ��ȣȯ���� ���� ���� URL�� ��� �����ϰ�
�ʹٰ� ��������. ����ڴ� ���� URL�� ����Ǿ�ٴ�
<
p>���� ��Ģ���� ���� URL�� ���������� ���ο� URL��
RewriteRule ^<
strong>foo</
strong>\.html$ <
strong>bar</
strong>.html
<
title>���� ���� (�˸���)</
title>
�����ϰ� ��ȣȯ���� ���� ���� URL�� ��� �����ϰ�
�ʹٰ� ��������. ���� ������ ���� URL�� ����ϸ�
����ڿ��� ���ο� URL�� ��Ʈ�� �˷��ش�. ��, ������
<
p>���ο� URL�� HTTP �����̷����ϴ�. ���� ������
���ο� URL�� ���̰� �������� ����ڰ� �˰Եȴ�:</
p>
RewriteRule ^<
strong>foo</
strong>\.html$ <
strong>bar</
strong>.html [<
strong>R</
strong>]
<
title>������ �� ����</
title>
<
p>�ּ��� �߿��� �ֻ��� �������� ������ ����ȭ��
�������� �����ؾ��� ��찡 �ִ�. ��, �ֽ� Netscape
������Դ� �ֻ��� ������, Lynx ������Դ�
���� ������, ������ ������� ������� ������
<
p>������ ��������� ���� �ڽ��� ���� ���� ������
�������� �ʱ���� ��������� ����� �� ���. ���
HTTP "User-Agent" ����� ����Ѵ�. ���� ��Ģ�� HTTP
"User-Agent" ����� "Mozilla/3"���� �����ϸ�
���ۼ��ϰ� ���ۼ��� �ߴ��Ѵ�. ������ "Lynx"��
"Mozilla" ���� 1 Ȥ�� 2��� URL��
RewriteCond %{HTTP_USER_AGENT} ^<
strong>Mozilla/3</
strong>.*
RewriteRule ^foo\.html$ foo.<
strong>NS</
strong>.html [<
strong>L</
strong>]
RewriteCond %{HTTP_USER_AGENT} ^<
strong>Lynx/</
strong>.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^<
strong>Mozilla/[12]</
strong>.*
RewriteRule ^foo\.html$ foo.<
strong>20</
strong>.html [<
strong>L</
strong>]
RewriteRule ^foo\.html$ foo.<
strong>32</
strong>.html [<
strong>L</
strong>]
<
p>�ܺ� ȣ��Ʈ�� �츮 ����Ʈ�� �������� ���� ����
���������� �ִٰ� ��������. FTP ������ ��� ���� �ܺ�
�ڷ��� �ֽź��纻�� �����ϴ� <
code>mirror</
code> �����
����� �� �ְ�, ��������� HTTP�� ����� �۾��� �ϴ�
<
code>webcopy</
code> ���α��� ����� �� �ִ�. ����
�� ��� ��� ������ �ִ�: ���纻�� ���� ���α���
�������� ���� �ֽ������� �����ȴ�. ���� �����ؾ��ϴ�
������ �̷��� �ƴ϶�� ���ڴ�. ��� (�ܺ� ȣ��Ʈ����
�ڷᰡ ���ŵǸ�) �ʿ��Ҷ� �ڵ����� �ڷḦ �����ϴ�
<
p>�̸� ���� <
dfn>Proxy Throughput</
dfn> ����� (�÷���
<
code>[P]</
code>) ����Ͽ� �ܺ� �������� Ȥ�� �ܺ�
���� ��ü�� �츮 �̸������� �����Ѵ�:</
p>
<
title>���� ���̷�</
title>
<
title>��� �ڷḦ ��Ʈ��ݿ��� ��������</
title>
<
p>���� �ڷḦ ��ȭ���� ��ȣ�ϴ� (����) ��Ʈ��� ��������
�����ϴ� ��ó�� ���̰� �Ѵ�. �ܺ� �������� ��û��
�ڷḦ ���� ���������� �����´�.</
p>
<
p>���� ��ȭ���� ���� �������� ��ȣ�ϰ� �ܺ� ����������
���� ���������� �ڷḦ ���� �� �ְ� �Ѵ�. ������ ����
��Ŷ���� ��ȭ���� �����Ѵ�:</
p>
<
strong>DENY</
strong> Host * Port * --> Host
www2.quux-corp.dom Port <
strong>80</
strong>
<
p>���� �������� �˸°� ���Ķ�. ��� �ڷḦ ����������
proxy throughput ����� ���� ��û�ϴ�
<
module>mod_rewrite</
module> ��Ģ�� �ۼ��Ѵ�:</
p>
RewriteRule ^/~([^/]+)/?(.*) /home/$
1/
.www/$2
RewriteCond %{REQUEST_FILENAME} <
strong>!-f</
strong>
RewriteCond %{REQUEST_FILENAME} <
strong>!-d</
strong>
RewriteRule ^/home/([^/]+)/.www/?(.*) http://<
strong>www2</
strong>
.quux-corp.dom/~$
1/
pub/$2 [<
strong>P</
strong>]
<
title>�ε�뷱�� (���� �л��ϱ�)</
title>
<
code>www[0-5]
.foo.com</
code> (�� ���� 6��)���� �л��ϰ�
<
p>�ſ� �پ��� ������� �� ������ �ذ��� �� �ִ�.
���� DNS�� ����� �� �˷��� ����� �����ϰ�,
<
module>mod_rewrite</
module>�� ����ϴ� ��츦 ���캸��:</
p>
<
strong>DNS Round-Robin</
strong>
<
p>���� ������ �ε�뷱�� ����� <
code>BIND</
code>��
DNS round-robin ����� ����ϴ� ���̴�. ������
���� DNS A(address) ���ڵ忡
<
code>www[0-9]
.foo.com</
code>�� �����Ѵ�.</
p>
<
p>���� ���� ���� �߰��Ѵ�:</
p>
<
p>�߸�� ��ó�� ��������, ������ <
code>BIND</
code>��
���, <
code>BIND</
code>�� �Ź� �� ���ݾ�
�ٲ㰡�� <
code>www0-www6</
code>�� ��ȯ�Ѵ�. ����
Ŭ���̾�Ʈ���� ���� ������ �л��Ѵ�. ���� DNS
�˻� ��� ��Ʈ���� �ٸ� ���Ӽ����� ij���ǿ�
����������� �Ϻ��� �ε�뷱�� ����� �ƴ���
�����϶�. ���� ũ�� ���� ��û�� ���� ��������
<
strong>DNS �ε�뷱��</
strong>
�ִ� <
code>lbnamed</
code> ���α��� ����Ͽ�
������ DNS��� �ε�뷱���� �� �� �ִ�. DNS��
���� �ε�뷱���� �ϵ��� ����� ���� ������ Perl
<
strong>Proxy Throughput Round-Robin</
strong>
<
p>�� ����� <
module>mod_rewrite</
module>�� proxy
throughput ����� ����Ѵ�. ���� DNS�� ���� ����
������ �����Ѵ�. ��, URL�� ������ ������ ����
���Ͻø� ���� �ٸ� 5�� ������ (<
code>www1-www5</
code>)
�Ѵ�� �����⸸ �Ѵ�. �̸� ���� ���� ��� URL��
�ε�뷱�� ��ũ��Ʈ <
code>
lb.pl</
code>�� ������
RewriteRule ^/(.+)$ ${lb:$1} [P,L]
<
p><
code>
lb.pl</
code>�� �ۼ��Ѵ�:</
p>
##
lb.pl -- �ε�뷱�� ��ũ��Ʈ
$name = "www"; # �⺻ ȣ��Ʈ��
$first = 1; # ù��° ���� (�ڽ��� 0�̱� ������, 0�� ������� �ʴ´�)
$last = 5; # round-robin���� ������ ����
$cnt = (($cnt+1) % ($last+1-$first));
$server = sprintf("%s%d.%s", $name, $cnt+$first, $domain);
<
note>������ ����: �� �� ����� �����Ѱ�?
����, �δ��� �ȴ�. ���� �ܼ��� proxy throughput
��û�� �ϱ���� �����! ��� SSI, CGI, ePerl
���� �������� �ٸ� ������ ó���Ѵ�. �̰��� �ٽ��̴�.</
note>
<
strong>�ϵ����/TCP Round-Robin</
strong>
<
p>�ϵ��� ����� �ذ�å�� �ִ�. Cisco��
TCP/
IP ���ؿ��� �ε�뷱���� �ϴ� LocalDirector��� ������
�Ǵ�. �����δ� �������� �մܿ� ��ġ�ϴ� ������
ȸ�μ��� ����Ʈ���̴�. �ڱ��� ����ϰ� �?��
�ذ�å�� �ʿ��ϴٸ� �̰��� ����϶�.</
p>
<
title>���ο� MIME-type, ���ο� ����</
title>
<
p>��Ʈ������ ���� CGI ���α����� ����. ���� ����ϱ�
��ŷ����� ���� �����ڰ� ������� �ʴ´�. ����ġ��
MIME-type�� �� Action �ڵ鷯 ��ɵ� CGI ���α���
Ư���� URL�� (��Ȯ�� <
code>PATH_INFO</
code>��
<
code>QUERY_STRINGS</
code>) ���α��� �Է����� �������
���� ���� �����ϴ�. ����, Ȯ���ڰ� (secure CGI�� �ٿ�)
<
code>.scgi</
code>�� ������ ������ <
code>cgiwrap</
code>
���α����� ó���ϱ����� ���ο� type�� �����Ѵ�.
������ (������ ��) �ϰ�� URL ������ ����ϴ� ���
URL�� ���̴�. <
code>cgiwrap</
code>��
���ϱ���̴�. ���� ��Ģ�� ������ �ذ��Ѵ�:</
p>
RewriteRule ^/[uge]/<
strong>([^/]+)</
strong>/\.www/(.+)\.scgi(.*) ...
<
p>���� �ٸ� ���� ���α�, (URL ����Ʈ���� ����
<
code>
access.log</
code>�� ����ϴ�) <
code>wwwlog</
code>��
(URL ����Ʈ���� Glimpse�� �����ϴ�) <
code>wwwidx</
code>��
�ִٰ� ��������. �츮�� ���α����� �۾��� �����
URL ������ �˷���� �Ѵ�. ���� ��û�Ҷ����� ��
������ �ϱ���� ������� �ʴ�. ��, ����
<
code>/
u/
user/
foo/</
code>�� ���� <
code>swwidx</
code>
���α��� �����Ѵٸ� ������ ���� ��ũ�� ����Ѵ�</
p>
<
p>������� �ʴ�. ��ũ�� ������ ��ġ<
strong>��</
strong>
CGI ��ġ�� <
strong>���</
strong> ���� �ϱ���̴�.
������ �籸���Ѵٸ� ���� �����۸�ũ�� �����ϴµ� ����
<
p>�ذ�å�� �ڵ����� ������ CGI�� �����ϴ� ���ο�
Ư���� URL ����� ����� ���̴�. ������ ���� �����Ѵ�:</
p>
<
p>���� <
code>/
u/
user/
foo/</
code>�� �˻��ϴ� ��ũ��
<
p>���������� ������ ���� �ڵ���ȯ�ȴ�</
p>
<
p>���� ������� ��ũ �ڿ� <
code>:log</
code>�� ����Ͽ�
���� �α� CGI ���α��� ������ �� �ִ�.</
p>
<
title>���� ��������</
title>
<
p>��� ������� ����ڰ� �� �ڿ������� ����
<
p>URL�� CGI ��ũ��Ʈ�� ���ۼ��ϰ�, MIME-type�� �����Ͽ�
CGI ��ũ��Ʈ�� �����ϰ� �Ѵ�. ����
RewriteRule ^foo\.<
strong>html</
strong>$ foo.<
strong>cgi</
strong> [T=<
strong>
application/
x-httpd-cgi</
strong>]
<
title>�N ������ ���</
title>
<
p>�� ����� �Ƿ� ����̴�: �������� �������� ��������,
�������� �������� �����Ѵ�. ��, �������� ����ϰ�
(���Ͻý��ۿ��� ���� ������ �״��) ���� ��������
�������, ���� ��� �������� �������� ���Ѵ�.
���� ���� (Ȥ�� cron �۾���) ���� �������� �������ʴ�
�� CGI�� ���� �������� �������� �����Ѵ�. ��������
����� ������ �����Ѵ�.</
p>
RewriteCond %{REQUEST_FILENAME} <
strong>!-s</
strong>
<
code>
page.html</
code>�� ��ų� ����ũ�Ⱑ 0�� ���
���������� <
code>
page.cgi</
code>�� �����Ѵ�. ���⼭
����� <
code>
page.cgi</
code>�� �Ϲ����� CGI ��ũ��Ʈ��
���� <
code>STDOUT</
code>�� ����ϰ�, �߰��� �����
<
code>
page.html</
code> ���Ͽ� ��´�. �ѹ� ��������
������ <
code>
page.html</
code>�� ������ ������. �����ڰ�
����� ������ �����ϰ� �ʹٸ�, (���� cron �۾���)
<
title>�ڵ����� ���� ��ħ�ϴ� ����</
title>
<
p>������ ���������� ���鶧 �����ڰ� ������ ������
������ �ڵ����� �������� ���� ��ħ�ϴ� ��������
������ �� ������? �Ұ����Ѱ�?</
p>
<
p>�����ϴ�! MIME multipart ��ɰ� ������ NPH ���,
<
module>mod_rewrite</
module>�� URL ���� �ɷ��� �����ϸ�
�ȴ�. ����, ���ο� URL ����� �����: URL��
<
code>:refresh</
code>�� �߰��ϱ⸸ �ϸ� ���Ͻý��ۿ���
������ ������ ���� ��ħ�Ѵ�.</
p>
<
p>���� ���� URL�� �����ϸ�</
p>
<
p>���� URL�� ���������� ���</
p>
<
p>���� NPH-CGI ��ũ��Ʈ�� ���Ҵ�. ���� "���ڿ���
�������� ���ܵ�"�̶�� �������� ;-) ���� �̰͵� �����Ѵ�.</
p>
## nph-refresh --
NPH/
CGI script for auto refreshing pages
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
# split the QUERY_STRING variable
@pairs = split(/&/, $ENV{'QUERY_STRING'});
($name, $value) = split(/=/, $pair);
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
eval "\$$name = \"$value\"";
$QS_s = 1 if ($QS_s eq '');
$QS_n = 3600 if ($QS_n eq '');
print "&lt;b&gt;ERROR&lt;/b&gt;: No file given\n";
print "&lt;b&gt;ERROR&lt;/b&gt;: File $QS_f not found\n";
sub print_http_headers_multipart_begin {
$bound = "ThisRandomString12345";
&print_http_headers_multipart_next;
sub print_http_headers_multipart_next {
sub print_http_headers_multipart_end {
print "Content-length: $len\n\n";
local(*FP, $size, $buffer, $bytes);
($x, $x, $x, $x, $x, $x, $x, $size) = stat($file);
$size = sprintf("%d", $size);
open(FP, "&lt;$file");
$bytes = sysread(FP, $buffer, $size);
$buffer = &readfile($QS_f);
&print_http_headers_multipart_begin;
&displayhtml($buffer);
($x, $x, $x, $x, $x, $x, $x, $x, $x, $mtime) = stat($file);
$mtimeL = &mystat($QS_f);
for ($n = 0; $n &lt; $QS_n; $n++) {
$mtime = &mystat($QS_f);
$buffer = &readfile($QS_f);
&print_http_headers_multipart_next;
&displayhtml($buffer);
$mtimeL = &mystat($QS_f);
&print_http_headers_multipart_end;
<
title>�뷮�� ����ȣ��Ʈ</
title>
<
p>����ȣ��Ʈ�� ��� �ִٸ� ����ġ�� <
directive type="section" module="core">VirtualHost</
directive>
����� �� �����Ѵ�. ���� ����ȣ��Ʈ�� ���鰳 �ִ�
ISP��� �� ����� �ּ��� �ƴϴ�.</
p>
<
p>�� ����� �����Ϸ��� <
dfn>Proxy Throughput</
dfn>
����� (�÷��� <
code>[P]</
code>) ����Ͽ� �ܺ� ��������
Ȥ�� ��ü �ܺ� �������� �츮�� �̸��� �����Ѵ�:</
p>
# �����̷�Ʈ�Ҷ� ���� ȣ��Ʈ���� ����Ѵ�.
# ����ȣ��Ʈ�� CLF ��� �տ� �߰��Ѵ�
# �ּ������� ���ۼ� ������ ����Ѵ�
# �� ���� �����Ѵ�: �ϳ��� URL�� ��ġ��,
# �ٸ� �ϳ��� ����ȣ��Ʈ�� DocumentRoot��
RewriteMap lowercase int:tolower
# ���� ũ�� ������ ��Ģ �Ѱ��� ����Ͽ�
# 1. ����ȣ��Ʈ���� ���� ����ϴ� ��ġ�� �������� �ʴ´�
RewriteCond %{REQUEST_URL} !^/commonurl1/.*
RewriteCond %{REQUEST_URL} !^/commonurl2/.*
RewriteCond %{REQUEST_URL} !^/commonurlN/.*
# 2. �츮�� ���� ����ϴ� ����� Host �����
# Host ����� �ִ��� Ȯ���Ѵ�
RewriteCond %{HTTP_HOST} !^$
# 3. ȣ��Ʈ���� �ҹ��ڷ� �����
RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
# 5. ���������� URL�� ���� ��ġ�� �����ϰ�
# �α� ��������� ����ȣ��Ʈ�� ����� �д�
RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]
<
p>��� �ϸ� Ư�� ������ �������� �ܾ������ ������
�κ��� ���� �� �ֳ�? "Robot Exclusion Protocol" ����
������ <
code>/
robots.txt</
code> ������ ���� �̷� �κ���
<
p>(�Ƹ��� ���丮�� �� �κ��� ���ƴٴϸ� ������
�ִ� URL���� �ź��ϴ� ��Ģ�� ����Ѵ�. �츮�� Ư��
�κ��� ������ ���ƾ� �Ѵ�. ��, �κ��� �����ϴ� ȣ��Ʈ��
���� �����δ� ������ϸ�, �� ȣ��Ʈ�� ����ڵ� ���ƹ�����
�ȴ�. User-Agent HTTP ��� ������ ���Ѵ�.</
p>
RewriteCond %{HTTP_USER_AGENT} ^<
strong>NameOfBadRobot</
strong>.*
RewriteCond %{REMOTE_ADDR} ^<
strong>123\.45\.67\.[8-9]</
strong>$
RewriteRule ^<
strong>/~
quux/
foo/
arc/</
strong>.+ - [<
strong>F</
strong>]
<
title>�� �۰��� ����</
title>
���������� GIF ���� �����Ѵٰ� ��������. �� ����
���־, �ٸ� ������� �ڽ��� �������� ���� ��ũ��
�Ǵ�. ������ ���ʿ��� �δ��� �ǹǷ� ���� �ʹ�.</
p>
<
p>���� 100% ��ȣ�� ���� ������, �ּ��� ������
HTTP Referer ����� ������ ��� ������ �� �ִ�.</
p>
RewriteCond %{HTTP_REFERER} <
strong>!^$</
strong>
RewriteRule <
strong>.*\.gif$</
strong> - [F]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !.*/foo-with-gif\.html$
RewriteRule <
strong>^inlined-in-foo\.gif$</
strong> - [F]
<
p>��� �ܺο��� ������ ������ �� ��� ȣ��Ʈ �����
<
p>����ġ >= 1.3b6����:</
p>
RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR]
RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND
<
p>����ġ <= 1.3b6����:</
p>
RewriteRule ^/(.*)$ ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}/$1
RewriteRule !^NOT-FOUND/.* - [F]
RewriteRule ^NOT-FOUND/(.*)$ ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}/$1
RewriteRule !^NOT-FOUND/.* - [F]
RewriteRule ^NOT-FOUND/(.*)$ /$1
## ����! �̰��� ���ó�� �������� ����� �ƴ϶� ���̴�.
## mod_rewrite�� �� ������ Ű/�� ������ �ؼ��ϱ����,
## �� ���� �� �ڸ��� �ּ��� "-"�� �ʿ��ϴ�.
<
p>��� Ư�� ȣ��Ʈ Ȥ�� Ư�� ȣ��Ʈ�� ����ڰ�
����ġ ���Ͻø� ����� �� ��� �ϳ�?</
p>
<
p>���� ����ġ �������� �������Ҷ� �������Ͽ���
<
module>mod_rewrite</
module>�� <
module>mod_proxy</
module>
�Ʒ���(!) �־�� �Ѵ�. ���� <
module>mod_rewrite</
module>��
<
module>mod_proxy</
module> <
em>����</
em> �Ҹ���.
���� ������ ���� Ư�� ȣ��Ʈ�� �ź��ϵ��� �����Ѵ�...</
p>
RewriteCond %{REMOTE_HOST} <
strong>^badhost\.mydomain\.com$</
strong>
<
p>...���� ������ user@host�� ��� �ź��Ѵ�:</
p>
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <
strong>^badguy@badhost\.mydomain\.com$</
strong>
<
title>Ư���� ���� ���</
title>
<
p>���� �ſ� Ư���� ������ �ʿ��� ���� �ִ�. ����
���, �̸� �����ص� ��������� �˻��Ѵ�. �̵鿡�Ը�
(<
module>mod_auth_basic</
module>�� Basic Auth�� �����
���� ��) ���ٸ� �������� ������ ����Ѵ�.</
p>
<
p>ģ���� ������ �����ϵ��� ���ۼ� ��Ģ���� ����Ѵ�:</
p>
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <
strong>!^friend1@client1.quux-corp\.com$</
strong>
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <
strong>!^friend2</
strong>@
client2.quux-corp\.com$
RewriteCond %{REMOTE_IDENT}@%{REMOTE_HOST} <
strong>!^friend3</
strong>@
client3.quux-corp\.com$
<
title>Referer��� ��ȯ��(deflector)</
title>
<
p>"Referer" HTTP ����� ��� ���ϴ´�� ������������
������ �� �ִ� ������ URL ��ȯ�⸦ ���� �� �ִ°�?</
p>
<
p>������ ���� ������ ��Ģ��...</
p>
RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}} ^-$
RewriteRule ^.* %{HTTP_REFERER} [R,L]
RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]
<
p>... ���ۼ� �ʰ� ���� ����Ѵ�:</
p>
<
p>���� ��û�� �ڵ����� (�ʿ��� ������ "<
code>-</
code>"��
����� ���) ������������ (URL�� �ʿ� �ִ� ��� �ι�°
�ƱԸ�Ʈ��) Ư�� URL�� �����̷����Ѵ�.</
p>
<
title>�ܺ� ���ۼ� ����</
title>
<
p>FAQ: ��� �̷��� ����� ������ Ǯ �� �ִ°�?
<
module>mod_rewrite</
module>�δ� �ذ�å�� �Ⱥ��δ�...</
p>
module="mod_rewrite">RewriteMap</
directive>�� ����϶�.
module="mod_rewrite">RewriteMap</
directive> ������
�Ѵ�. ���α��� ����ġ�� �����Ҷ� �����Ͽ�
<
code>STDIN</
code>���� ��û�� URL�� �ް�, (���� ���!)
��� (���� ���ۼ���) URL�� <
code>STDOUT</
code>�� ����Ѵ�.</
p>
RewriteRule ^/~quux/(.*)$ /~quux/<
strong>${quux-map:$1}</
strong>
# ����ġ ������ ������ �ʵ���
# ����� ���۸� ������� �ʴ´�
# stdin���� ���پ� URL�� �а�
# stdout�� ��ȯ�� URL�� ����Ѵ�
<
p>�����ϱ����� ��� <
code>/~
quux/
foo/...</
code> URL��
<
code>/~
quux/
bar/...</
code>�� ���ۼ��ϴ� ��ũ��Ʈ��
���� ����. ������ ������� ���α����� �� �ִ�.
���� �Ϲ� ����ڰ� �̷� ���� <
strong>�����</
strong>
�� �ִٰ� �ϴ����, ���� �ý��� ���ڸ��� ����
<
strong>�����ؾ�</
strong> ���� �����϶�.</
p>