<-
Apache > HTTP Server > Documentation > Version 2.4

URL �$ 9� �/h1>
¹® 5 � 5±Ù ó°� �) ¹® � Âü� .

¹® 2 URL �'� 9� �� ºþ � �$ 9� ã ' �

Âü

top

�( ¸ð � � /a>

top

DocumentRoot

2 � 9 � � ºþ ' °á ±â ±âº»� 2 URL-°æ (URL �$ � � � � � ��)� �< ' DocumentRoot � ºÞ ±× DocumentRoot ¼°� ¸®� � º¸ ±âº» �)4

top

DocumentRoot � � /a>

"" �$ DocumentRoot ' �� � ±Ù � 9 °æ �� ' ¹æ �) � ¬º¼¸� �) �$ ¤¸� �� DocumentRoot º¸ 9 � ¸® OptionsFollowSymLinks SymLinksIfOwnerMatch� °æ0 � ¬º¼¸� ��

, Alias � �$ � �� ¹°�� � � � � °¶¸é

Alias /docs /var/web

URL http://www.example.com/docs/dir/file.html /var/web/dir/file.html �'� ºþ ' °æ ¸ð �) CGI � ¬¸�� Ãë � � � ScriptAlias � � �

AliasMatch ScriptAliasMatch � �% ·±� � 9� �) � � �% � �

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

http://example.com/~user/cgi-bin/script.cgi� 2 °æ /home/user/cgi-bin/script.cgi� �, � � CGI � ¬¸�� Ãë

top

�) �/a>

� �< � �) user ¸® ~user/� '9 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 ¸® 9� � ' � � ¤¸� � �)

� � (º¸ � %7e� �) ) "~" ±â � � ¤¸� ¹æ< �) ¸® � �4 ±â� mod_userdir °ø ' ±×� �) ¸® �9 ¹æ� ±¸1ä¸�, 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 ¸®�4 (Redirection)

� � �� 9� �$ � � �) ��48 � � º¸� � ±×� � 2 �) ¤¸� URL � ��48 � � ¤Á� ��48 � � � URL 2� � � " � � ¸®�4 (redirection)�� � Redirect � �) � � DocumentRoot /foo/ ¸® �) � /bar/ ¸® ��¤¸� � � � ��48 � � 9� 2�

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

±×ì¸� www.example.com � /foo/� URL-°æ /foo/� /bar/� �� URL� ¸®�4 ��48 � ¼¸ � ¤¸� �� ¸®�4

, 9 º¹! � ¹® � RedirectMatch � °ø � � ¤¸� 2 ±× � � �4 � 2 ¤¸� �4 � ¸®�4ä¸�:

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

� �4 � ¸ð � � ¤¸� �4 � � � � ¸®�4ä¸�:

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

top

�(Reverse Proxy)

9 ¤¸� � ¹® � � URL °ø� °¼ °æ � �� � � ¹® � °¼ ��48 � � � � � � ±â ¹® � ¹æ �(reverse proxying)� ��48 � � � �� ¹® � º¸ôÁ� �2 º¸4 � � � ¤¸�

� ��48 � /foo/ ¹® � 2� � internal.example.com /bar/ ¸® ¹® � °¼ ¹® � �9 � �2 ��48 � � º¸�

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

ProxyPass �� ¹® � °¼$ � � � ProxyPassReverseinternal.example.com º¸� ¸®�4 �1 ¸®�4 � ¸® °¸� � � , ProxyPassReverseCookieDomain� ProxyPassReverseCookieDomain � ¹æ� �� º¸ Äï �1

±×� ¹® ¸È �1 ' ÁÖ internal.example.com ¸È ��48 � ��� internal.example.com� ' 2� � � � mod_proxy_html ¸ð �) HTML� XHTML ¸È �1

top

� ' (Rewriting Engine)

�% 9 mod_rewrite � ' ¸ð � �<0 "� ��48 � IP ÁÖ 2 � �'� � �) ºþ ' °á , mod_rewrite 2 �� 2¸® ' °á ±â � �4 �� �4 á±�� �) � ' ¤·� "� , &, � ¸®�4 (alias), � ¸®�4 , �, ¸ð � ' mod_rewrite� �) � URL 'ħ �

top

File Not Found

°á±¹ 2 URL � �$ ã ¸ø °æ04 � �' � � � °æ ¹® � ¤¸� °÷< ��� ¹® °æ ��48 � � URL ¸®�4 � � 9� ¤Á� ¹æ " ±×ì¸� �� � ö¸� ¸È � �

"File Not Found" � ¤¸� � � �<0 ' � HTML ¸È URL � � °æ04 9 mod_speling (çÃ� ¸® ) ¸ð � � � ¹® � ¸ð �) � "File Not Found" � � � °æ ¾w � �' ã � ð°� � mod_speling ��48 � � � 9� HTTP ¸®�4 "¾w " � �� ¤¸� ��48 � � ¸ñ º¸�

mod_speling � � � ¹® � ±¸ '� � �� ±â�4 ±× �$ � URL ¹® � '¸ø �) � � ±×� mod_speling # URL ³Ì� ¤¸�, "¸ø " 2� URL ¸®�4 � ��48 � � 2 �4 �� � ½´

ã � ¸ð � � � 9 HTTP status code 404 (file not found) �� � º¸� � �) ErrorDocument � Á¶ � �) � /a> ¹® � Âü �)

�% �  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.