url_forwarding.txt
9KB · 283 lines
���� : [�] URL ����� ��
�ۼ��� : ��ĥ��[��:���] san2(at)linuxchannel.net
���� : ������ �ʺ��ڿ�
2000.04.09 : ���� �ۼ�
2000.06.10 : �κ� ����
*��)
�� ���� ��� �Ⱓ��� ��� ����� �Ϻκ�� �ణ �� �߰��ؼ�
�ø� ����Դϴ�.
����� ����� "��Ī��" �����ϰڽ��ϴ�.
----------------------------------------------------------------------
*��) ��� - �� ������ ���Ե� ����
��� ���� ������ ���ߵ�� ���� �ʺ���� ����� ���ɻ� �� �ϳ��̴�.
�� ������ �Խ���� ������ ������ �亯���� �� ���� �ܰ� �մ�ó��
����ϰ� �Ѵ�.
��� �����Ǵ� ����� ����̴� ���� ��� �� �Բ� �� �� �ִ� ������,
���� ���� �� �ڼ��� ���� �߰��Ͽ� �ʺ��ڰ� �����ϱ� ������ ����
���ҽ��ϴ�.
-----------------------------------------------------------------------
���
1. URL ����� ���� ���ؼ�
2. [��1] Ư�� ������ ��Ÿ�±� �̿��� ��
3. [��2] �ڹٽ�ũ��Ʈ�� �̿��� ��
4. [��3] PHP3���� ����� ��
5. [��4] ����ġ ����� �� Redirect�� �̿��� ��
6. ��ġ��
1. URL ����� ���� ���ؼ�
�� ���������� URL ������̶� ��� �� ���Ʈ���� Ư�� ������
�ٸ� URL�� �̵���� �ǹ��Ѵ�.
���� ���,
http://www.linux.ac.kr/~kernel�� �Է���� ���, �ڵ�����
http://kernel.linux.ac.kr ���Ʈ�� �̵��ϰ� �ϴ� ���̴�.
Ư� �ʺ��ڰ� ���� �����ϴ� "����� �����"�ϰ�� ����������
�ٸ�����, �ϳ��� Ư�� ����ο��� �ٸ� �������� �̵��Ѵٴ�(�����)
������ ���� ���� ������ �ִ�.
*��)-----------------------------------------------------------------
��ڰ� �����ϴ� "����� �����"�� �� Ư�� ������ �����ϴ� ��Ӽ���
�ּҸ� �ٸ� �ּҷ� �̵�(?)��� �ǹ��Ѵٰ� �����Ѵ�.
BIND8�� ��Ʈ ���(named.conf)���� ����� ���� ���.
options {
...
forward only ;
forwarders {192.168.12.8 ; 192.168.12.9;};
..
};
�Ǵ�
zone "linux.ac.kr" {
type forward;
forward only ;
forwarders {192.168.12.8 ; 192.168.12.9;};
..
};
����� ������� ���� ��Ȯ�� ���ǿ� ����� �ִ� ��� ��� ��� ��Ϸ�
�亯�� �ֽø� ���ڽ��ϴ�.
---------------------------------------------------------------------
URL�� ������ϴ� ���� ũ�� 4���� ������ ���� �ִ�.
��1) HTML ���� ���� ��Ÿ�±� �̿��� ��
��2) �ڹٽ�ũ��Ʈ�� �̿��� ��
��3) PHP���� Header() �Լ��� �̿��� ��
��4) ����ġ ����� �� Redirect�� �̿��� ��
��̴�.
�� �߿��� ��1, 2, 3�� �� ���丮 ���� �̹� �����ϴ� ��������
�����ؾ��Ѵ�. ��, �ý��� �����ڰ� �ƴ� �� ���� ���ϴ� ��������
����ϱ� ���� ���̴�.
����� �������� [Back] ��ư�� ����� ���, �ٷ� ��� URL��
�̵��ϱ� ���ٴ� ���̴�.(0�ʷ� ������� ���)
�� �̵��� �����ߴ� ���Ʈ�� ���� �ٷ� �ٸ� ���Ʈ�� �̵��ϰ� ��
������ ���ұ� �����̴�.
���� ��忡���� ���� ������ ���� �����ʾ� �ִ�.
�̷� ���� ���̿��ؼ� �ٸ� ���Ʈ�� �̵���� ���ϰ�(?)�ϴ� ���Ʈ��
�� �ִ�..
�� �ι� �� ������ ��� ����� �ϴ´�.
�ݸ�, ��4�� ����ġ ���� ������ ��忡�� �����ؾ��ϸ� ���� ������
���������(�Ǵ� ������� �ʾҾ �����ϴ�.) ����� �� ���丮�� ����
������� ��� ��쿡 ������ ���̴�.
�ַ� Ư�� ȣ��Ʈ ��ü�� ��ü�� �̵��ϰ�� �� ��쿡 ������ ���̴�.
2. [��1] Ư�� ������ ��Ÿ�±� �̿��� ��
����, �� �ּҰ� http://www.linux.ac.kr/~kernel
�̰�, �� �ּҸ� http://kernel.linux.ac.kr���� �̵��ϰ� �Ϸ���
http://www.linux.ac.kr/~kernel/index.html ��Ͽ�
����� ���� ���� ��Ÿ�±� �߰��Ѵ�.
----------index.html --------------------------------------------------
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=http://kernel.linux.ac.kr">
<title>You will be moved to my new homepage automatically...
</title>
</head>
<body bgcolor=white>
You will be moved to my new homepage automatically...
If not, you can move manually clicking
<a href="http://kernel.linux.ac.kr">here</a>.
</body>
</html>
-----------------------------------------------------------------------
��� ���� ������ ���̱� ���ؼ� ����(body)�� ���� �־�־���.
�߿��� ����
<meta http-equiv="Refresh" content="0; URL=http://kernel.linux.ac.kr">
�̴�.
content="5; URL=http://kernel.linux.ac.kr"
�� ���� �����ϸ� 5�� �� http://kernel.linux.ac.kr URL�� �̵��Ѵ�.
3. [��2] �ڹٽ�ũ��Ʈ�� �̿��� ��
��2�� ������ ���̴�.
----------index.html --------------------------------------------------
<script LANGUAGE="JavaScript">
document.location="http://kernel.linux.ac.kr";
</script>
-----------------------------------------------------------------------
4. [��3] PHP3���� ����� ��
���� �� 2, 3�� ������ ���̴�.
----------index.php3 --------------------------------------------------
<?
header("Location:http://kernel.linux.ac.kr");
?>
-----------------------------------------------------------------------
����ؾ��� ����
header() �Լ��� ����ϱ��� �ٷ� �� �ٿ� echo()�Լ��� printf()���� ����� �Ѵ�.
���� header() �Լ� ����� echo() �Լ��� �ִٸ� ������ ���� ��̴�.
�̴� SetCookie() �Լ��� ����ϴ� ���� �Ȱ��� �ٷ���� �Ѵ�.
5. [��4] ����ġ ����� �� Redirect�� �̿��� ��
�� ���� ����ġ ���� ������ ��忡�� �����ϴ� ������
���� �Ұ��ߴ� 3���� ������ �ٸ���
���� �����ߴ� �����̵� ������� �ʾҴ� �����̵��� �����
Ư�� ������ ���丮�� �ٸ� URL�� �̵��ϴ� ���̴�.
Redirect <��� URL> <���ο� URL>
Redirect ����ڴ�, ����� ������ ������� ��� ����(URL)�� ���ؼ� �ٸ� URL�� �����
�Ѵ�.
�� ����ڴ� Ŭ��̾�Ʈ ��忡�� �ſ� �����ϴ�.
������ �ڽ�� Ȩ������ ���� ������ ��������� ����� �ٸ� ������ �Ű���ٸ� Ŭ��
�̾�Ʈ���� �˷��� �ʿ䰡 �ִ�. ���� URL ������� ���� ��忡�� HTML ��Ÿ �±�
��������� ������忡�� Redirect ����ڸ� �̿��Ͽ� ���� ������� �����ϴ�.
���� ���� Redirect ����� ���� �����ϴ�.
����� ������ ����.
���� 1 : Redirect /kernel http://kernel.linux.ac.kr
���� 2 : Redirect /linux/kernel.html http://kernel.linux.ac.kr
���� 3 : Redirect /~study http://www.linux.ac.kr/study.html
<��� URL>�� �ش��ϴ� �κ�� "http://"�� ����ϴ� URL�� �ƴϰ� DocumentRoot�� ȣ
��Ʈ ��� ����� �� URL �κ�� ���Ѵ�. <���ο� URL>�� ����� �����ϴ� URL��
�ǹ��ϸ� �ڱ� �ڽ�� ���������� ����� �̸��� URL�� �Է��Ѵ�.
"ServerName www.linux.ac.kr"�̶�� ������ ������ ����� ���� ������Ѵ�.
�� 1 : http://www.linux.ac.kr/kernel �� http://kernel.linux.ac.kr
�� 2 : http://www.linux.ac.kr/linux/kernel.html �� http://kernel.linux.ac.kr
�� 3 : http://www.linux.ac.kr/~study �� http://www.linux.ac.kr/study.html
[����]
Ư�� ���� Ȩ ������ �ٸ� URL�� �����ϰ� �ͽ��ϴ�. HTML�� ������ �ʰ� ����ġ
�������� �����մϱ�?
[�亯]
�� �����մϴ�. Redirect ����ڸ� Ȱ���Ͻʽÿ�.
���� ��� ����("aaa") Ȩ ���丮 ��ü�� http://www.boo.com/~aaa�� �����ϰ� �ʹٸ�
����ġ �������� ����� ���� �߰��մϴ�.
Redirect /~aaa http://www.boo.com/~aaa
���� ���� ȣ��Ʈ�� ����� ���Ƿ� ����ϱ� �ٶ��ϴ�.
[�亯 ��]
[�] ���� ȣ��Ʈ�� ���� Redirect Ȱ��(��� ����)
<VirtualHost ...>
...
Redirect /index.html http://www.someothers.com/
..
</VirtualHost>
�̿� ���� DocumentRoot�� index.html ��Ͽ� ���ؼ� ���������� �ٸ� �� �ּҷ� ������
��.
���� ����� ���� ��쿡�� �����ϵ��� �Ѵ�.
Redirect / http://www.someothers.com/
�� ��ü�� �����ϴ� ���̹Ƿ� �ٸ� ���� ȣ��Ʈ�� ���� �شٴ� ���̴�.
���� ���� Ʋ�� ���� �ƴ���� �������� URL�̵��� ��� �� ����Ƿ�
�뵵��̸� ���� ������ ���ǿ� �־�ִ°�� ����.
Ư� ����� ���� �ϳ��� ���Ǿȿ��� ������ ��쿡�� ���� �����ؾ��Ѵ�.
Ʋ�� ���(X) :
Redirect / http://www.someothers.com/
Redirect /~san2 http://san2.someothers.com/
�´� ���(O) :
Redirect /~san2 http://san2.someothers.com/
Redirect / http://www.someothers.com/
�� ���� �κ�(/~san2)�� ��� �����ϰ� ����� �κ�(/)�� ���ʿ� ����ؾ��Ѵ�.
���� ����� ��쵵 ����� ������ ����ϵ��� �Ѵ�.
�ָ��� ��� :
Redirect /~san2 http://www.someothers.com/
�´� ����
Redirect /~san2 http://www.someothers.com
�Ǵ�
Redirect /~san2/ http://www.someothers.com/
��, <��� URL> �������� "/" �����̴�.
��� �ָ��� ��츦 ���� ����.
���ڰ� ����� ���� <��� URL>�� ��û�ߴٰ� �ϸ�,
http://www.linux.ac.kr/~san2/linux/
����
http://www.someothers.com//linux/
�̿� ����. "//" �κ�� �� �ΰ��� ����� ���������� �� ��� ��̴�.
���� ���, �̿� ���� �߸��� URL �������� ����ġ ��μ����� �ִ�ġ�� �����ߴ�
����� �־���.......(��.......����...150��...T.T)
�������� <��� URL> ������ ������ "/"�� ���ٸ� <���ο� URL>�� ����������
"/"�� �� �־�ζ�� ���ϰ� �ʹ�.
�� �ݴ�� "/"�� ���� ����� <���ο� URL>���� "/"�� ��� �ʵ��� �Ѵ�.
[� ��]
6. ��ġ��
����� ������ ���ؼ� ª�Գ��� ���� �����ߴ� ������ ����� ������� ��
������� ����ȭ�� ���ҽ��ϴ�.
�� ������ �� ������ ��ü �Ǵ� �κ�� ���� �� �����ؼ� ������ �� �����
�ڽ�� Ȩ������ ��ũ �Ǵ� �ڽ�� Ȩ������ �÷����Ƶ� ������ϴ�.
���� ������� �̿��� ��ȹ�̶� �� ��ڿ��� ���� ��Ͼ��� ����� ��
�ֽ��ϴ�
��,
�� ������ ���ؼ��� ���� ��� ����� ������ �˷��帳�ϴ�.
���ۼ��ڸ� ǥ����� �ʾƵ� �������, �ʿ��ϴٰ� �����Ǹ� ���ۼ��ڸ�
ǥ���ص� ������ϴ�.
��,
����� ���������� ���ظ� �־��� ���, ���ο��� ��� �������� å���
������ �̸� �����ϴ� �� �Դϴ�.
�����մϴ�.
�� ������ ����̳� �߸��� ���� �����
�Ʒ��� ����� Ȩ���� ������ �亯�� �Խ���� �̿��� �ּ���� ���ڽ��ϴ�.
http://www.linuxchannel.net/
--------end------------------------------------------------------------------