Web Study/킴스큐 Rb

[킴스큐 Rb]킴스큐 Rb .htaccess 파일의 디폴트 룰

파노카페 2012. 10. 9. 22:43

Rewrite 룰에 대한 기본 개념을 알아봤으니 킴스큐 Rb .htaccess 룰을 하나하나 짚어봐야겠다. 

아래는 킴스큐 Rb .htaccess의 디폴트 룰임 (킴스큐 Rb 버전 1.2.0 기준)

---------------------------------------------------------------------------------

RewriteEngine On


#기본사이트

RewriteRule ^(admin)/?$ ./index.php?m=$1&module=$1 [L]

RewriteRule ^(p)/([a-zA-Z0-9_\-]+)/?$ ./index.php?mod=$2 [L]

RewriteRule ^(c)/([a-zA-Z0-9_\-\/]+)/?$ ./index.php?c=$2 [L]

RewriteRule ^([0-9]+)/?$ ./index.php?m=bbs&uid=$1 [L]

RewriteRule ^(b)/?$ ./index.php?m=bbs [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/?$ ./index.php?m=bbs&bid=$2 [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3 [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/write/?$ ./index.php?m=bbs&bid=$2&mod=write [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&s=$4 [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4#CMT [L]

RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4&s=$5#CMT [L]


#사이트코드 확장

RewriteRule ^([a-zA-Z0-9_\-]+)/?$ ./index.php?r=$1 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(admin)/?$ ./index.php?r=$1&m=$2&mdule=$2 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(p)/([a-zA-Z0-9_\-]+)/?$ ./index.php?r=$1&mod=$3 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(c)/([a-zA-Z0-9_\-\/]+)/?$ ./index.php?r=$1&c=$3 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/([0-9]+)/?$ ./index.php?r=$1&m=bbs&uid=$2 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/?$ ./index.php?r=$1&m=bbs [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/?$ ./index.php?r=$1&m=bbs&bid=$3 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/?$ ./index.php?r=$1&m=bbs&bid=$3&uid=$4 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/write/?$ ./index.php?r=$1&m=bbs&bid=$3&mod=write [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?r=$1&m=bbs&bid=$3&uid=$4&s=$5 [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/?$ ./index.php?r=$1&m=bbs&bid=$3&uid=$4&CMT=$5#CMT [L]

RewriteRule ^([a-zA-Z0-9_\-]+)/(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?r=$1&m=bbs&bid=$3&uid=$4&CMT=$5&s=$6#CMT [L]

---------------------------------------------------------------------------------

아직은 문법이 많이 헷갈리니까 정규 표현식 기본에 대해서 다시 한 번 짚고 넘어가자!

Regex vocabulary (정규표현식 어휘)

The following are the minimal building blocks you will need, in order to write regular expressions and RewriteRules. They certainly do not represent a complete regular expression vocabulary, but they are a good place to start, and should help you read basic regular expressions, as well as write your own.


아래는 당신이 정규 표현식과 RewriteRule을 사용할 수 있는데에 필요한 최소한의 구성 요소이다. 물론 아래의 구성 요소는 정규 표현식의 모든 어휘를 포함하는 것은 절대 아니지만 최소한 당신이 기초적인 정규 표현식을 읽을 수 있고 또한 직접 작성할 수 있게 도와줄 첫 걸음이 될 것이다. 

Character

(문자)

Meaning
(의미)
Example
(예제)
.

Matches any single character
(아무 단일 문자에 상응한다)

c.t will match catcotcut, etc.
(c.t는 cat, cot, cut 등에 상응한다.)  
+Repeats the previous match one or more times
(문자가 한 번 또는 그 이상 상응함을 나타낸다)

a+ matches aaaaaa, etc
(a+는 a, aa, aaa등에 상응한다)
*Repeats the previous match zero or more times.
(문자가 0번 혹은 그 이상 상응함을 나타낸다)

a* matches all the same things a+ matches, but will also match an empty string.
(a*는 a+에 상응하는 모든 문자에 상응하고 또한 빈 문자에도 상응한다)

?Makes the match optional.
(선택적 상응을 나타낸다. 즉, 있어도 되고 없어도 됨)

colou?r will match color and colour.
(colou?r는 color와 colour에 상응한다)
^Called an anchor, matches the beginning of the string
(앵커라고 불리우며 스트링의 시작을 나타낸다)

^a matches a string that begins with a
(^a는 a로 시작하는 스트링에 상응한다)
$The other anchor, this matches the end of the string.
(스트링의 끝을 나타내는 또 다른 앵커)

a$ matches a string that ends with a.
(a$는 a로 끝나는 스트링에 상응한다)
( )

Groups several characters into a single unit, and captures a match for use in a backreference.
(다수의 문자들을 하나의 유닛으로 묶는다. 역참조시 매칭되는 부분을 Substition(대체) 변수에 담긴다.)

(ab)+ matches ababab - that is, the + applies to the group. For more on backreferences see below.
( (ab)+는 ababab에 상응한다. 이 말은 +가 묶음에 적용된다는 뜻이다. backreference에 대한 설명은 아래 참고)
[ ]

A character class - matches one of the characters
(문자 클래스 - 문자들 중 하나에 상응한다. 즉, []안에 있는 문자들 중 하나라도 있으면 상응함)

c[uoa]t matches cutcot or cat.
( c[uoa]t 는 cut, cot, cat에 상응한다)
[^ ]

Negative character class - matches any character not specified
(부정 문자 클래스 - 설정되지 않은 문자에 상응한다. 즉, ^뒤에 지정된 문자가 아니면 상응함)

c[^/]t matches cat or c=t but not c/t
( c[^/]는 cat이나 c=t에 상응하지만 c/t에는 상으하지 않는다)

In mod_rewrite the ! character can be used before a regular expression to negate it. This is, a string will be considered to have matched only if it does not match the rest of the expression.


mod_rewrite에서 ! 문자는 정규식 앞에 사용되면 부인한다는(반대된다는) 의미이다. 즉, 스트링이 정규식에 상응하지 않을 때 정규식 앞에 !을 붙임으로써 상응하게 되게 것이다. 


RewriteEngine On

-> Rewrite 모듈 호출


#기본사이트

RewriteRule ^(admin)/?$ ./index.php?m=$1&module=$1 [L]


Pattern 부분:
-> ^(admin) : admin으로 시작함. 즉, http://hostname/admin 형식이 됨. ()괄호안의 내용은 $1변수의 내용이 됨. 
-> /? : "/"가 있어도 되고 없어도 됨. ? 구문이 헷갈리는게 ? 다음이 오는 문자가 아닌 전에 오는 문자에 대해서 선택적이라는 뜻임. 반대인줄 알고 한참 헤맸네..-_-; 즉, http://hostname/admin 도 되고 http://hostname/admin/ 도 된다는 뜻. 
-> $: 정규식의 끝을 나타냄. 보니까 모든 룰의 Pattern 부분 끝에 $가 있는데 이 다음 룰 설명부터는 생략함. 
=> 결론적으로 "^(admin)/?$"에 매치되는 스트링은 adminadmin/ 두 개임

Substitution 부분:
-> $1은 "admin"이기 때문에 ./index.php?m=$1&module=$1은 "./index.php?m=admin&module=admin"이 된다. 
-> 사용예) http://hostname/admin, http://hostname/admin/ 둘 중 하나

The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed. This corresponds to the last command in Perl, or the break command in C. Use this flag to indicate that the current rule should be applied immediately without considering further rules.


[L] 플래그는 mod_rewrite 에게 룰 세트에 대한 처리를 중단시킨다. 대부분의 컨텍스트에서 이것은 만약 매칭되는 룰이 있으면 이후에 오는 룰에 대한 처리는 중단된다는 뜻이다. 이것은 Perl에서의 last 명령어, C에서의 명령어와 break 명령어와 일치한다. 이후에 오는 룰을 고려하지 않고 현재 룰을 바로 적용시키기 위해 이 플래그를 사용하라. 


If you are using RewriteRule in either .htaccess files or in <Directory> sections, it is important to have some understanding of how the rules are processed. The simplified form of this is that once the rules have been processed, the rewritten request is handed back to the URL parsing engine to do what it may with it. It is possible that as the rewritten request is handled, the .htaccess file or <Directory> section may be encountered again, and thus the ruleset may be run again from the start. Most commonly this will happen if one of the rules causes a redirect - either internal or external - causing the request process to start over.


만약 RewriteRule 을 .htaccess 파일이나 <Directory> 섹션에서 사용한다면, 이 룰들이 어떻게 처리가 되는지 이해하는 것이 중요하다. 이것의 간단한 형태는 - 일단 룰이 처리가 되면, 재작성된 리퀘스트는 URL 파싱 엔진에게 되돌려 나머지 작업을 시킨다. 이때 재작성된 리퀘스트 작업이 이루어지면서 .htaccess 파일이나 <Directory> 섹션이 다시 불러질 수 있고 이때 룰 세트가 처음부터 다시 시작될 수 있다. (무한루프 발생 가능성!!!) 대부분의 경우에 이것은 룰 중 하나가 리다이렉팅(내부적이든 외부적이든)을 실행하여 리퀘스트 프로세스를 처음부터 다시 시작하게 할 때 발생한다.   


It is therefore important, if you are using RewriteRule directives in one of these contexts, that you take explicit steps to avoid rules looping, and not count solely on the [L] flag to terminate execution of a series of rules, as shown below.


그러므로 RewriteRule  명령을 이러한 컨텍스트들 중 하나에서 사용한다면, 룰의 무한루핑을 방지하기 위해 단순히 [L] 플래그를 사용하여 룰의 실행을 종료하는 것에만 의존하지 말고 아래와 같이 확실한 절차를 밟아줘야 한다. ([L]에서 L은 Last의 약자인듯)


An alternative flag, [END], can be used to terminate not only the current round of rewrite processing but prevent any subsequent rewrite processing from occuring in per-directory (htaccess) context. This does not apply to new requests resulting from external redirects.


대체 플래그인 [END]는 rewrite 프로세스의 현재 룰뿐 아니라 이후의 디렉토리별 (htaccess) 컨텍스트에서의 rewrite 프로세싱까지 종료할 때 사용될 수 있다. 이것은 외부 리다이렉트에서 발생되는 새로운 리퀘스트에 적용되지 않는다. 


The example given here will rewrite any request to index.php, giving the original request as a query string argument to index.php, however, the RewriteCond ensures that if the request is already for index.php, the RewriteRule will be skipped.


아래 예제는 오리지널 리퀘스트를 index.php에 대한 쿼리 스트링 인자로 하여 index.php으로의 어떠한 리퀘스트라도 리라이팅한다. 하지만, 만약 리퀘스트가 이미 index.php에 대한 것이라면 RewriteCond은 스킵된다. (예제에서 [PT]는 Pass Through의 뜻 - 간략 설명: The target (or substitution string) in a RewriteRule is assumed to be a file path, by default. The use of the [PT] flag causes it to be treated as a URI instead. - 자세한 설명은: http://httpd.apache.org/docs/2.4/en/rewrite/flags.html#flag_pt 참고)


RewriteBase /
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule ^(.*) /index.php?req=$1 [L,PT]


RewriteRule ^(p)/([a-zA-Z0-9_\-]+)/?$ ./index.php?mod=$2 [L]


Pattern 부분:
-> ^(p) : p로 시작함. 즉, http://hostname/p 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?mod=$2에서 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+) 부분이 된다. 

etc:
-> Pattern 부분의 "p"는 킴스큐에서 page, 즉 페이지를 의미한다. 
-> 아마도 index.php?mod=$2 에서 "mod"는 페이지를 나타내는 변수명 같다. ("m"은 모듈을 의미하는 듯) 페이지에 왜 "mod"라고 이름을 붙인지는 모르겠다. 어떤 이는 modification의 mod일 수도 있다고 추정을 하는데... 암튼 헷갈린다. 그냥 p라고 해도 되지 않을까 싶은데..
-> 사용예) http://hostname/p/mypage



RewriteRule ^(c)/([a-zA-Z0-9_\-\/]+)/?$ ./index.php?c=$2 [L]

Pattern 부분:
-> ^(c) : c로 시작함. 즉, http://hostname/c 형식이 됨. 
-> ([a-zA-Z0-9_\-\/]+) : 문자(대소문자 알파벳, 숫자,-,_,\,/)의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?c=$2에서 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-\/]+) 부분이 된다. 

etc:
-> Pattern 부분의 "c"는 킴스큐에서 메뉴(더 자세히 말하면 메뉴코드)를 의미하는 것 같다. 그래서 menu code에서 code의 c를 따와 c라고 이름을 붙인게 아닌 지 추측.. 어떤이는 contents의 c인 것 같다고 하는데 이에 대한 언급은 킴스큐 홈페이지에서 없는 것 같음. 
-> 아마도 index.php?mod=$2 에서 "mod"는 페이지를 나타내는 변수명 같다. ("m"은 모듈을 의미하는 듯)
-> 사용예) http://hostname/c/uppermenu1, http://hostname/c/uppermenu1/menu2



RewriteRule ^([0-9]+)/?$ ./index.php?m=bbs&uid=$1 [L]

Pattern 부분:
-> ^([0-9]+) : 숫자의 조합. ex) http://hostname/1234 형식이 됨. 
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&uid=$1에서 $1 변수의 내용은 Pattern에서 ([0-9]+) 부분이 된다. 

etc:
-> 예를 들어 http://hostname/1234의 경우는 게시글의 uid가 "1234"인 게시글을 보여준다. 
-> 사용예) http://hostname/1, http://hostname/112



RewriteRule ^(b)/?$ ./index.php?m=bbs [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs를 호출

etc:
-> ./index.php?m=bbs을 호출하면 모든 게시판의 모든 글이 다 보여진다. 
-> 사용예) http://hostname/b, http://hostname/b/ 둘 중 하나임




RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/?$ ./index.php?m=bbs&bid=$2 [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2에서 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 된다. 

etc:
-> ./index.php?m=bbs&bid=$2은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2인 게시판의 글 목록을 불러온다. 
-> 사용예) http://hostname/b/freeboard, http://hostname/b/notice 




RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3 [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> ([0-9]+) : 숫자의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2&uid=$3에서 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 되고 $3 변수의 내용은 Pattern에서 ([0-9]+)가 된다. 

etc:
-> ./index.php?m=bbs&bid=$2&uid=$3은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2이고 게시글 id(uid)가 $3인 게시글 본문 내용을 보여준다. 
-> 사용예) http://hostname/b/freeboard/1234, http://hostname/b/notice/11 
-> 특이사항(?): 게시글의 uid만 올바르다면 게시판 id 부분($2 즉 ([a-zA-Z0-9_\-]+))은 어떤 문자가 와도 상관이 없음. 실제 존재하는 게시판의 id이든 아니든 간에 끝의 게시글 uid만 실제 존재한다면 정상적으로 해당 게시글의 내용을 불러온다. 





RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/write/?$ ./index.php?m=bbs&bid=$2&mod=write [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> write : 반드시 "write"이어야 함 
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2&mod=write에서 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 된다. 

etc:
-> ./index.php?m=bbs&bid=$2&mod=write은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2인 게시판에 새로운 글을 쓰겠다는 의미임. "mod=write" 부분에서는 아마도 bbs 모듈에 있는 write.php 페이지를 호출하는 것으로 추정됨. 
-> 사용예) http://hostname/b/freeboard/write, http://hostname/b/notice/write 





RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&s=$4 [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> ([0-9]+) : 숫자의 조합
-> s([0-9]+) : s+숫자의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2&uid=$3&s=$4 $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 되고 $3변수의 내용은 ([0-9]+), 그리고 $4 변수의 내용은 s([0-9]+)이 된다. 

etc:
-> ./index.php?m=bbs&bid=$2&uid=$3&s=$4은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2인 게시판에서 게시글 id가 $3에서... "s" 파라미터가 무엇을 뜻하는지 모르겠다!-> 알아냈음. 한줄의견을 의미하는 거였다. 아마도 single에서 따온 듯 싶음. 즉 게시글 id가 $3인 게시글의 한 줄 의견을 의미한다. 
-> 사용예) http://hostname/b/freeboard/123/s1, http://hostname/b/notice/10/s4




RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4#CMT [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> ([0-9]+) : 숫자의 조합
-> ([0-9]+) : 숫자의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4#CMT $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 되고 $3변수의 내용은 ([0-9]+), 그리고 $4 변수의 내용은 ([0-9]+)이 된다. 

etc:
-> ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4#CMT은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2인 게시판에서 게시글 id가 $3인 게시글에 달린 댓글 ID가 $4인 댓글을 호출한다. 
-> 사용예) http://hostname/b/freeboard/123/999999998http://hostname/b/notice/10/999999999
-> 끝 부분의 #CMT는 무슨 의미인지 모르겠다.. 이 부분이 없어도 동일하게 작동하는 것 같은데. ==> 페이지 내 링크였다.-_-. 이게 없으면 로딩된 html 페이지의 맨 위부분이 보이고 이 부분을 적용하면 html 페이지 로딩 후 댓글 부분이 화면에 보인다. 





RewriteRule ^(b)/([a-zA-Z0-9_\-]+)/([0-9]+)/([0-9]+)/s([0-9]+)/?$ ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4&s=$5#CMT [L]

Pattern 부분:
-> ^(b) : b로 시작. ex) http://hostname/b 형식이 됨. 
-> ([a-zA-Z0-9_\-]+) : 문자(대소문자 알파벳, 숫자,-,_,\)의 조합
-> ([0-9]+) : 숫자의 조합
-> ([0-9]+) : 숫자의 조합
-> s([0-9]+) : s+숫자의 조합
-> /? : "/"가 있어도 되고 없어도 됨
-> $정규식의 끝을 나타냄.  

Substitution 부분:
-> ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4&s=$5#CMT $2 변수의 내용은 Pattern에서 ([a-zA-Z0-9_\-]+)부분이 되고 $3변수의 내용은 ([0-9]+), $4 변수의 내용은 ([0-9]+), 그리고 $5 변수의 내용은 s([0-9]+)이 된다. 

etc:
-> ./index.php?m=bbs&bid=$2&uid=$3&CMT=$4&s=$5#CMT은 게시판 모듈을(게시판 모듈 id는 "bbs"임) 호출하고 이때 게시판 id가(bid) $2인 게시판에서 게시글 id가 $3인 게시글에 달린 댓글 ID가 $4인 댓글... s 파라미터가 무슨 의미인지 몰라서 일단 패쓰! -> 알아냈음. 한줄의견을(여기서는 댓글의 댓글을 의미) 의미하는 거였다. 아마도 single에서 따온 듯 싶음. 즉 댓글 id가 $4인 댓글에 달린 한 줄 의견을 의미한다.  
-> 사용예) http://hostname/b/freeboard/123/999999998/s1http://hostname/b/notice/10/999999999/s2
-> 여기서 #CMT는 댓글의 댓글의 위치로 이동시킴. 



"#사이트코드 확장"부분은 제일 앞에 사이트 코드가 적용된다는 점을 제외하고는 기본적으로 "기본사이트"의 룰과 동일하다.