½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 114 | Á¶È¸¼ö 4,579 | µî·ÏÀÏ 2004-10-02 16:35:37

´Ð³×ÀÓ

namdengi

À̸ÞÀÏ

namdengi@empal.com

Á¦¸ñ

[ÀçÁú¹®] ÇϳªÀÇ °èÁ¤¿¡ ´ÙÁß µµ¸ÅÀÎ ¿¬°á½Ã ¹®Á¦
³»¿ë
#! /usr/bin/perl

# µµ¸ÞÀÎÀ» ÁöÁ¤Çϼ¼¿ä.
$a = "a.com";
$b = "b.com";

if ($ENV{'SERVER_NAME'} =~/$a/) {
 print "location:http://www.a.com/a\n\n";
 exit;
}
elsif ($ENV{'SERVER_NAME'} =~/$b/) {
 print "location:http://www.b.com/b\n\n";
 exit;
}
else {
 print "location:http://www.c.com/a\n\n";
 exit;
}

 

À§ cgi¸¦ °í¸¿°Ô Àß ¾²°í ÀÖ½À´Ï´Ù. ±Ã±ÝÇÑ °ÍÀÌ À־ ÀÌ·¸°Ô ¿°Ä¡ºÒ±¸ÇÏ°í ÀçÁú¹®À» µå¸²´Ï´Ù.

[Áú¹®]

1) µµ¸ÅÀÎÀ» ´Ã¸®·Á¸é  $xxx="µµ¸ÅÀÎ" ÀÌ·¸°Ô °è¼Ó Ãß°¡ÇÏ°í elsifºÎºÐÀ» °è¼Ó Ãß°¡¸é µÇ´Â °ÍÀÎÁö¿ä?

2) À§¿¡¼­ º¸¸é cµµ¸ÅÀÎÀ» Á¤ÇØÁÖÁö ¾ÊÇߴµ¥¡¦¡¦ µµ¸ÅÀÎÁöÁ¤ÀÌ ¾ø°Å³ª µµ¸ÅÀÎÁöÁ¤ÀÌ µÇ¾îÀ־ if, elsif¿¡ ¾øÀ¸¸é  elseÀÌ ºÎºÐÀ» ¸ðµÎ µû¸£´Â °ÍÀÎÁö¿ä?

3) À§ cgi¸¦ ¾Æ·¡Ã³·³ ÀÀ¿ëÇÏ·Á°í Çϴµ¥ À߸øµÈ ºÎºÐÀÌ ÀÖ´ÂÁö ºÁÁÖ¼¼¿ä.
Á¦°¡ ¸¸µç°ÍÀÌ ¾Æ´Ï°í ¶æÀ» ¸ð¸£°í ¼Ò µÞ°Å¸§ Ä¡´Ù Áã ÀâµíÀÌ ²ç ¸ÂÃç¼­ µÇ±ä µÇ´Âµ¥¡¦¡¦ <<END_LINE ¿Í END_LINE
Àº ¹«½¼ ¶æÀ» °¡Áö´Â °ÍÀÌÁö ÁÖ¼® Á» ´Þ¾Æ ÁÖ¼¼¿ä.

if ($ENV{'SERVER_NAME'}=~/$a/) {
   print "Content-type:text/html\n\n";
   &Asite_PRINT;
   exit;

sub Asite_PRINT{
print <<END_LINE;

htmlű׻ðÀԺκÐ

END_LINE
exit;
}

 

¿î¿µÀÚ´Ô Ç×»ó °í¸¿½À´Ï´Ù. ¾È³çÈ÷ °è¼¼¿ä.


 

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û [Áú¹®] ¾ÆÀÌÇÁ·¹ÀÓ Å¸°Ù ¼³Á¤ 2004-09-29 02:55:46
´ÙÀ½°Ô½Ã±Û Ç÷¹À̾ ã½À´Ï´Ù. 2004-10-05 16:15:05