adjustPath ÀÎÀÚ·Î È®ÀåÀÚ´ë½Å "." À» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
$tpl->prefilter = "adjustPath & . ";
ÀÌ ¶§´Â "./ ¶Ç´Â './ ¶Ç´Â url(./ ·Î ½ÃÀÛÇÏ´Â ¹®ÀÚ¿Àº ¸ðµÎ »ó´ë°æ·Î·Î ÀνÄÇÏ°Ô µË´Ï´Ù.
ÀÌ ¹æ¹ý°ú ÇÔ²² È®ÀåÀÚ·Î ÀνÄÇÏ´Â ¹æ¹ýµµ °°ÀÌ »ç¿ëÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÁöÁ¤ÇÕ´Ï´Ù.
$tpl->prefilter = "adjustPath & .,css,js,gif,jpg,jpeg,png,swf ";
ÀÎÀÚÀÇ °¡Àå ¾Õ¿¡ '.' °¡ ÀÖÀ¸¸é µË´Ï´Ù.
'.' °¡ Àû¿ëµÇ¾úÀ» ¶§µµ "\./ '\./ url(\./ ·Î À̽ºÄÉÀÌÇÁÇÒ ¼ö ÀÖ½À´Ï´Ù.

adjustPath() ÇÔ¼ö³»¿¡´Â »ç¿ëÀÚ°¡ Á¤ÀÇÇÒ ¼ö ÀÖ´Â µÎ °³ÀÇ º¯¼ö°¡ ÀÖ½À´Ï´Ù.
| Template_.prefilter.adjustPath.php |
|
<?php
function adjustPath(&$source, &$tpl, $indicator='') { // $default_indicator = 'css,js,gif,jpg,jpeg,png,swf'; $path_filter = array(); // ... } ?> |
$default_indicator´Â adjustPath ÇÊÅÍÀÇ ÀÎÀÚ¸¦ ÁöÁ¤ÇÏÁö ¾Ê¾ÒÀ» ¶§ »ç¿ëµÇ´Â ±âº»°ªÀ̸ç, $path_filter ´Â º¯È¯µÈ °æ·Î¸¦ ÇÑ ¹ø ´õ º¯È¯Çϱâ À§ÇØ »ç¿ëµÇ´Â Á¤±ÔÇ¥Çö½Ä ÆÐÅÏÀÔ´Ï´Ù.
¿¹¸¦ µé¾î ȨÆäÀÌÁö´Â http://www.xtac.net Àε¥ gif ÆÄÀÏÀº http://gif.xtac.net ¿¡, jpg ÆÄÀÏÀº http://jpg.xtac.net ÀúÀåµÇ¾î ÀÖÀ» ¶§, °¢¼¹öÀÇ µð·ºÅ丮 ±¸Á¶°¡ °°´Ù¸é ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
$path_filter = array(
'/^(.*gif)$/'=>'http://gif.xtac.net$1',
'/^(.*(jpg|jpeg))$/'=>'http://jpg.xtac.net$1',
);
'/^(.*gif)$/'=>'http://gif.xtac.net$1',
'/^(.*(jpg|jpeg))$/'=>'http://jpg.xtac.net$1',
);
ÀÌ Á¤±Ô½ÄÀº º¯È¯µÈ Àý´ë°æ·Î ¾Õ¿¡, È®ÀåÀÚ¿¡ ¸Â´Â µµ¸ÞÀγ×ÀÓÀ» ºÙ¿©ÁÖ´Â ¿ªÇÒÀ» ÇÕ´Ï´Ù.
¶Ç´Â ´ÙÀ½°ú °°ÀÌ À¥¼¹öÀÇ ¸®´ÙÀÌ·º¼ÇÀÌ ¼³Á¤µÇ¾úÀ» ¶§,
RedirectMatch /imgA/(.*)\.(gif|jpg)$
http://image.xtac.net/templates/skinA/img/$1.$2
http://image.xtac.net/templates/skinA/img/$1.$2
$path_filter ¿¡´Â ¸®´ÙÀÌ·º¼ÇÀÇ ¿ªÀ¸·Î ÀÛ¼ºÇÏ¸é µÇ°í, ¸¶Âù°¡Áö·Î À̹ÌÁö¼¹ö¿Í À¥·çÆ®ÇÏÀ§°æ·Î°¡ °°À» ¶§ À¯È¿ÇÕ´Ï´Ù.
$path_filter = array(
'@^/templates/skinA/img/(.*)\.(gif|jpg)$@' => '/imgA/$1.$2'
);
'@^/templates/skinA/img/(.*)\.(gif|jpg)$@' => '/imgA/$1.$2'
);

| ÀÌÀü | ¸ñ·Ï | ´ÙÀ½ |

