<-
Apache > HTTP Server > Documentation > Version 2.4 > ¸ðµâ

¾ÆÆÄÄ¡ ¸ðµâ mod_alias

°¡´ÉÇÑ ¾ð¾î:  en  |  fr  |  ja  |  ko  |  tr 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:ÆÄÀϽýºÅÛÀÇ ´Ù¸¥ ºÎºÐµéÀ» ¹®¼­ °èÃþ±¸Á¶¿¡ Æ÷ÇÔÇÏ°í, URL ¸®´ÙÀÌ·º¼ÇÀ» Á¦°øÇÑ´Ù
»óÅÂ:Base
¸ðµâ¸í:alias_module
¼Ò½ºÆÄÀÏ:mod_alias.c

¿ä¾à

ÀÌ ¸ðµâÀÌ Á¦°øÇÏ´Â Áö½Ã¾îµéÀ» »ç¿ëÇÏ¿© ¼­¹ö°¡ ¿äûÀ» ¹ÞÀ»¶§ URLÀ» ¼öÁ¤Çϰųª Á¶ÀÛÇÒ ¼ö ÀÖ´Ù. Alias¿Í ScriptAlias Áö½Ã¾î´Â URLÀ» ÆÄÀϽýºÅÛ °æ·Î·Î ´ëÀÀÇÑ´Ù. ±×·¡¼­ DocumentRoot ¾Æ·¡¿¡ ¾ø´Â ³»¿ëÀ» À¥À¸·Î ¼­ºñ½ºÇÒ ¼ö ÀÖ´Ù. ¶Ç, ScriptAlias Áö½Ã¾î´Â ÁöÁ¤ÇÑ µð·ºÅ丮¿¡ CGI ½ºÅ©¸³Æ®¹Û¿¡ ¾ø´Ù°í ¾Ë¸°´Ù.

Redirect Áö½Ã¾î´Â Ŭ¶óÀ̾ðÆ®¿¡°Ô ´Ù¸¥ URL·Î »õ·Î¿î ¿äûÀ» Çϵµ·Ï Áö½ÃÇÑ´Ù. ÀÚ¿øÀ» »õ·Î¿î Àå¼Ò·Î ¿Å±ä °æ¿ì ÀÚÁÖ »ç¿ëÇÑ´Ù.

mod_alias´Â °£´ÜÇÑ URL Á¶ÀÛÀ» À§ÇØ ¼³°èµÇ¾ú´Ù. ÁúÀǹ®ÀÚ¿­ Á¶ÀÛ°ú °°Àº º¹ÀâÇÑ ÀÛ¾÷Àº mod_rewrite°¡ Á¦°øÇÏ´Â ±â´ÉÀ» ÀÌ¿ëÇ϶ó.

Support Apache!

ÁÖÁ¦

Áö½Ã¾îµé

Bugfix checklist

Âü°í

top

ó¸® ¼ø¼­

¼­·Î ´Ù¸¥ »ç¿ëÀå¼Ò¿¡¼­ Alias¿Í Redirect¸¦ »ç¿ëÇÏ¸é ´Ù¸¥ Áö½Ã¾î¿Í °°ÀÌ Ç¥ÁØ °áÇÕ ¹æ¹ý¿¡ µû¶ó ó¸®ÇÑ´Ù. ±×·¯³ª °°Àº »ç¿ëÀå¼Ò¿¡ (¿¹¸¦ µé¾î, °°Àº <VirtualHost> ¼½¼Ç¿¡) Alias¿Í Redirect¸¦ »ç¿ëÇÏ¸é ¾Æ·¡ ¼ø¼­´ë·Î ó¸®ÇÑ´Ù.

¸ÕÀú ¸ðµç Redirect¸¦ ó¸®ÇÑ ÈÄ Alias¸¦ ó¸®ÇÑ´Ù. ±×·¡¼­ Redirect³ª RedirectMatch¿¡ ÇØ´çÇÏ´Â ¿äûÀº Àý´ë·Î AliasÇÏÁö ¾Ê´Â´Ù. ±×¸®°í Alias¿Í Redirect´Â ¼³Á¤ÆÄÀÏ¿¡¼­ ù¹ø°·Î ³ª¿À´Â °ÍÀ» »ç¿ëÇÑ´Ù.

±×·¡¼­ ¿©·¯ Áö½Ã¾î°¡ µ¿ÀÏÇÑ ÇÏÀ§°æ·Î¿¡ ÇØ´çÇÏ´Â °æ¿ì ¸ðµç Áö½Ã¾î¸¦ Àû¿ëÇϱâÀ§Çؼ­´Â °¡Àå »ó¼¼ÇÑ °æ·Î¸¦ ¸ÕÀú »ç¿ëÇØ¾ß ÇÑ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½ ¼³Á¤Àº ÀǵµÇÑ´ë·Î µ¿ÀÛÇÑ´Ù:

Alias /foo/bar /baz
Alias /foo /gaq

±×·¯³ª À§ÀÇ µÎ Áö½Ã¾î ¼ø¼­¸¦ ¹Ù²Ù¸é /foo/bar Alias ÀÌÀü¿¡ /foo Alias¸¦ Àû¿ëÇϹǷΠÇ×»ó µÎ¹ø° Áö½Ã¾î¸¦ ¹«½ÃÇÑ´Ù.

top

Alias Áö½Ã¾î

¼³¸í:URLÀ» ƯÁ¤ ÆÄÀϽýºÅÛ Àå¼Ò·Î ´ëÀÀÇÑ´Ù
¹®¹ý:Alias URL-path file-path|directory-path
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_alias

Alias Áö½Ã¾î¸¦ »ç¿ëÇϸé ÆÄÀϽýºÅÛ¿¡¼­ DocumentRoot ¹Û¿¡ ÀÖ´Â ¹®¼­µµ ¼­ºñ½ºÇÒ ¼ö ÀÖ´Ù. url-path·Î ½ÃÀÛÇÏ´Â (%·Î ÀÎÄÚµùµÈ) URLÀ» directory-path·Î ½ÃÀÛÇÏ´Â ÆÄÀÏ¿¡ ´ëÀÀÇÑ´Ù.

¿¹Á¦:

Alias /image /ftp/pub/image

http://myserver/image/foo.gif¸¦ ¿äûÇÏ¸é ¼­¹ö´Â /ftp/pub/image/foo.gif ÆÄÀÏÀ» ³Ñ°ÜÁØ´Ù.

url-path ³¡¿¡ /¸¦ Æ÷ÇÔÇϸé, URL ³¡¿¡ /¸¦ »ç¿ëÇؾ߸¸ ¿µÇâÀÌ ÀÖÀ½À» ÁÖÀÇÇ϶ó. Áï, Alias /icons/ /usr/local/apache/icons/ ¼³Á¤Àº url /icons¿Í °ü°è°¡ ¾ø´Ù.

´ëÀÀÀÇ ´ë»óÀ» Æ÷ÇÔÇÏ´Â ¿©·¯ <Directory> ¼½¼ÇÀÌ ÇÊ¿äÇÒÁöµµ ¸ð¸¥´Ù. ÀÌ Áö½Ã¾î´Â <Directory> ¼½¼ÇÀ» °Ë»çÇϱâ Àü¿¡ ó¸®ÇϹǷÎ, ´ëÀÀÀÇ ´ë»ó¸¸ ¼½¼ÇÀÇ ¿µÇâÀ» ¹Þ´Â´Ù. (±×·¯³ª <Location> ¼½¼ÇÀº ÀÌ Áö½Ã¾î¸¦ ó¸®Çϱâ Àü¿¡ Çѹø¸¸ °Ë»çÇϹǷΠÁöÁ¤ÇÑ URL ÀÌÇÏ Àüü¿¡ ¿µÇâÀ» ÁØ´Ù.)

ƯÈ÷ DocumentRoot ¹Û¿¡ ÀÖ´Â µð·ºÅ丮·Î Alias¸¦ ¸¸µé¾ú´Ù¸é, Á÷Á¢ ´ë»ó µð·ºÅ丮ÀÇ Á¢±ÙÀ» Çã¿ëÇØÁà¾ß ÇÑ´Ù.

¿¹Á¦:

Alias /image /ftp/pub/image
<Directory /ftp/pub/image>
Order allow,deny
Allow from all
</Directory>

top

AliasMatch Áö½Ã¾î

¼³¸í:Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÏ¿© URLÀ» ÆÄÀϽýºÅÛ Àå¼Ò·Î ´ëÀÀÇÑ´Ù
¹®¹ý:AliasMatch regex file-path|directory-path
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_alias

ÀÌ Áö½Ã¾î´Â Alias¿Í °°Áö¸¸, °£´ÜÈ÷ URLÀÇ ¾ÕºÎºÐ¸¸ ºñ±³ÇÏ´Â ´ë½Å Ç¥ÁØ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÑ´Ù. ÁöÁ¤ÇÑ Á¤±ÔÇ¥Çö½ÄÀ» URL °æ·Î¿Í ºñ±³ÇÏ¿© ¸Â´Ù¸é, ¼­¹ö´Â °ýÈ£·Î ¹­Àº ºÎºÐÀ» ´ëüÇÏ¿© ÆÄÀϸíÀ¸·Î »ç¿ëÇÑ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½°ú °°ÀÌ /icons µð·ºÅ丮¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù:

AliasMatch ^/icons(.*) /usr/local/apache/icons$1

top

AliasPreservePath Áö½Ã¾î

¼³¸í:Map the full path after the alias in a location.
¹®¹ý:AliasPreservePath OFF|ON
±âº»°ª:AliasPreservePath OFF
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory
»óÅÂ:Base
¸ðµâ:mod_alias
Áö¿ø:2.5.1 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

Redirect Áö½Ã¾î

¼³¸í:Ŭ¶óÀ̾ðÆ®°¡ ´Ù¸¥ URL¿¡ Á¢¼ÓÇϵµ·Ï ¿äûÇÏ´Â ¿ÜºÎ ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù
¹®¹ý:Redirect [status] URL-path URL
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:FileInfo
»óÅÂ:Base
¸ðµâ:mod_alias

Redirect Áö½Ã¾î´Â ÀÌÀü URLÀ» »õ·Î¿î URL·Î ´ëÀÀÇÑ´Ù. Ŭ¶óÀ̾ðÆ®¿¡°Ô »õ·Î¿î URLÀ» º¸³»°í, Ŭ¶óÀ̾ðÆ®´Â »õ·Î¿î ÁÖ¼Ò·Î ´Ù½Ã Çѹø Á¢¼ÓÇÑ´Ù. (%·Î ÀÎÄÚµùµÈ) URL-path·Î ½ÃÀÛÇÏ´Â ¿äûÀ» ¹ÞÀ¸¸é (%·Î ÀÎÄÚµùµÈ) URL·Î ½ÃÀÛÇÏ´Â »õ·Î¿î URL·Î ¸®´ÙÀÌ·º¼Ç ¿À·ù¸¦ º¸³½´Ù.

¿¹Á¦:

Redirect /service http://foo2.bar.com/service

Ŭ¶óÀ̾ðÆ®°¡ http://myserver/service/foo.txt¸¦ ¿äûÇÏ¸é ´ë½Å http://foo2.bar.com/service/foo.txt¿¡ Á¢±ÙÇ϶ó´Â ÀÀ´äÀ» ¹Þ´Â´Ù.

ÁÖÀÇ

Redirect Áö½Ã¾î´Â ¼³Á¤ÆÄÀÏ¿¡¼­ ³ª¿À´Â ¼ø¼­¿Í °ü°è¾øÀÌ Alias¿Í ScriptAlias Áö½Ã¾îº¸´Ù ¿ì¼±¼øÀ§°¡ ³ô´Ù. ¶Ç, .htaccess ÆÄÀÏÀ̳ª <Directory> ¼½¼Ç¿¡¼­ »ç¿ëÇÏ´õ¶óµµ URL-path¿¡´Â »ó´ë°æ·Î°¡ ¾Æ´Ï¶ó ¹Ýµå½Ã ¿ÏÀüÇÑ URLÀ» »ç¿ëÇØ¾ß ÇÑ´Ù.

status ¾Æ±Ô¸ÕÆ®¸¦ ÁöÁ¤ÇÏÁö¾ÊÀ¸¸é, "Àӽà (temporary)" (HTTP »óÅ 302) ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù. Áï, Ŭ¶óÀ̾ðÆ®¿¡°Ô ÀÚ¿øÀ» Àӽ÷Π¿Å°å´Ù°í ¾Ë¸°´Ù. status ¾Æ±Ô¸ÕÆ®¸¦ »ç¿ëÇÏ¿© ´Ù¸¥ HTTP »óÅÂÄڵ带 ¹ÝȯÇÒ ¼ö ÀÖ´Ù:

permanent
ÀÚ¿øÀ» ¿ÏÀüÈ÷ ¿Å°åÀ½À» ¶æÇÏ´Â ¿µ±¸ ¸®´ÙÀÌ·º¼Ç »óŸ¦ (301) ¹ÝȯÇÑ´Ù.
temp
Àӽà ¸®´ÙÀÌ·º¼Ç »óŸ¦ (302) ¹ÝȯÇÑ´Ù. ±âº»°ªÀÌ´Ù.
seeother
ÀÚ¿øÀÌ ±³Ã¼µÇ¾úÀ½À» ¶æÇÏ´Â "ÂüÁ¶ (See Other)" »óŸ¦ (303) ¹ÝȯÇÑ´Ù.
gone
ÀÚ¿øÀÌ ¿µ±¸È÷ »èÁ¦µÇ¾úÀ½À» ¶æÇÏ´Â "¼Ò¸ê (Gone)" »óŸ¦ (410) ¹ÝȯÇÑ´Ù. ÀÌ »óŸ¦ »ç¿ëÇϸé URL ¾Æ±Ô¸ÕÆ®¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù.

status¿¡ ¼ýÀÚ »óÅÂÄڵ带 »ç¿ëÇÏ¿© ´Ù¸¥ »óÅÂÄڵ嵵 ¹ÝȯÇÒ ¼ö ÀÖ´Ù. »óÅ°¡ 300°ú 399 »çÀ̶ó¸é URL ¾Æ±Ô¸ÕÆ®¸¦ »ç¿ëÇØ¾ß ÇÏ°í, ¾Æ´Ï¶ó¸é »ý·«ÇØ¾ß ÇÑ´Ù. ´Ü, ¾ÆÆÄÄ¡ Äڵ忡 »óÅ°¡ Á¤ÀǵÇÀÖ¾î¾ß ÇÑ´Ù (http_protocol.cÀÇ send_error_response ÇÔ¼ö Âü°í).

¿¹Á¦:

Redirect permanent /one http://example.com/two
Redirect 303 /three http://example.com/other

top

RedirectMatch Áö½Ã¾î

¼³¸í:ÇöÀç URLÀÌ Á¤±ÔÇ¥Çö½Ä¿¡ ÇØ´çÇÏ¸é ¿ÜºÎ ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù
¹®¹ý:RedirectMatch [status] regex URL
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:FileInfo
»óÅÂ:Base
¸ðµâ:mod_alias

ÀÌ Áö½Ã¾î´Â Redirect¿Í °°Áö¸¸, °£´ÜÈ÷ URLÀÇ ¾ÕºÎºÐ¸¸ ºñ±³ÇÏ´Â ´ë½Å Ç¥ÁØ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÑ´Ù. ÁöÁ¤ÇÑ Á¤±ÔÇ¥Çö½ÄÀ» URL °æ·Î¿Í ºñ±³ÇÏ¿© ¸Â´Ù¸é, ¼­¹ö´Â °ýÈ£·Î ¹­Àº ºÎºÐÀ» ´ëüÇÏ¿© ÆÄÀϸíÀ¸·Î »ç¿ëÇÑ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½Àº ¸ðµç GIF ÆÄÀÏ ¿äû¿¡ ´ëÇØ ´Ù¸¥ ¼­¹öÀÇ ºñ½ÁÇÑ À̸§À» °¡Áø JPEG ÆÄÀÏ·Î ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù:

RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg

top

RedirectPermanent Áö½Ã¾î

¼³¸í:Ŭ¶óÀ̾ðÆ®°¡ ´Ù¸¥ URL¿¡ Á¢¼ÓÇϵµ·Ï ¿äûÇÏ´Â ¿ÜºÎ ¿µ±¸ ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù
¹®¹ý:RedirectPermanent URL-path URL
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:FileInfo
»óÅÂ:Base
¸ðµâ:mod_alias

ÀÌ Áö½Ã¾î´Â Ŭ¶óÀ̾ðÆ®¿¡°Ô ¸®´ÙÀÌ·º¼ÇÀÌ ¿µ±¸ÀûÀÓÀ» (»óÅ 301) ¾Ë¸°´Ù. Redirect permanent¿Í Á¤È®È÷ °°´Ù.

top

RedirectRelative Áö½Ã¾î

¼³¸í:Allows relative redirect targets.
¹®¹ý:RedirectRelative On|Off
±âº»°ª:RedirectRelative Off
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory
»óÅÂ:Base
¸ðµâ:mod_alias
Áö¿ø:2.4.58 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

RedirectTemp Áö½Ã¾î

¼³¸í:Ŭ¶óÀ̾ðÆ®°¡ ´Ù¸¥ URL¿¡ Á¢¼ÓÇϵµ·Ï ¿äûÇÏ´Â ¿ÜºÎ Àӽà ¸®´ÙÀÌ·º¼ÇÀ» º¸³½´Ù
¹®¹ý:RedirectTemp URL-path URL
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:FileInfo
»óÅÂ:Base
¸ðµâ:mod_alias

ÀÌ Áö½Ã¾î´Â Ŭ¶óÀ̾ðÆ®¿¡°Ô ¸®´ÙÀÌ·º¼ÇÀÌ ÀÓ½ÃÀûÀÓÀ» (»óÅ 302) ¾Ë¸°´Ù. Redirect temp¿Í Á¤È®È÷ °°´Ù.

top

ScriptAlias Áö½Ã¾î

¼³¸í:URLÀ» ƯÁ¤ ÆÄÀϽýºÅÛ Àå¼Ò·Î ´ëÀÀÇÏ°í ´ë»óÀÌ CGI ½ºÅ©¸³Æ®¶ó°í ¾Ë¸°´Ù
¹®¹ý:ScriptAlias URL-path file-path|directory-path
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_alias

ScriptAlias Áö½Ã¾î´Â Alias Áö½Ã¾î¿Í ºñ½ÁÇÏÁö¸¸, Ãß°¡·Î ´ë»ó µð·ºÅ丮¿¡ mod_cgiÀÇ cgi-script Çڵ鷯°¡ ó¸®ÇÒ CGI ½ºÅ©¸³Æ®°¡ ÀÖ´Ù°í ¾Ë¸°´Ù. URL-path·Î ½ÃÀÛÇÏ´Â (%·Î ÀÎÄÚµùµÈ) URLÀ» ÆÄÀϽýºÅÛÀÇ Àý´ë°æ·ÎÀÎ µÎ¹ø° ¾Æ±Ô¸ÕÆ®·Î ½ÃÀÛÇÏ´Â ½ºÅ©¸³Æ®¿¡ ´ëÀÀÇÑ´Ù.

¿¹Á¦:

ScriptAlias /cgi-bin/ /web/cgi-bin/

http://myserver/cgi-bin/foo¸¦ ¿äûÇÏ¸é ¼­¹ö´Â /web/cgi-bin/foo ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ´Ù.

top

ScriptAliasMatch Áö½Ã¾î

¼³¸í:Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÏ¿© URLÀ» ƯÁ¤ ÆÄÀϽýºÅÛ Àå¼Ò·Î ´ëÀÀÇÏ°í ´ë»óÀÌ CGI ½ºÅ©¸³Æ®¶ó°í ¾Ë¸°´Ù
¹®¹ý:ScriptAliasMatch regex file-path|directory-path
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_alias

ÀÌ Áö½Ã¾î´Â ScriptAlias¿Í °°Áö¸¸, °£´ÜÈ÷ URLÀÇ ¾ÕºÎºÐ¸¸ ºñ±³ÇÏ´Â ´ë½Å Ç¥ÁØ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÑ´Ù. ÁöÁ¤ÇÑ Á¤±ÔÇ¥Çö½ÄÀ» URL °æ·Î¿Í ºñ±³ÇÏ¿© ¸Â´Ù¸é, ¼­¹ö´Â °ýÈ£·Î ¹­Àº ºÎºÐÀ» ´ëüÇÏ¿© ÆÄÀϸíÀ¸·Î »ç¿ëÇÑ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½°ú °°ÀÌ Ç¥ÁØÀûÀÎ /cgi-binÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù:

ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1

°¡´ÉÇÑ ¾ð¾î:  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 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 Libera.chat, or sent to our mailing lists.