제로보드 XE – IIS 서버에서 짧은 주소(Rewrite) 사용하기

 

적용 전 확인 사항

  • XE 1.7.3.4 Ver. 에서 테스트 확인
  • IIS 7 ~ 8 테스트 확인
  • IIS 서버에 URL Rewrite 모듈 설치 확인

 

XE 폴더에 위치한 web.config 파일을 메모장이나 에디터 플러스 등으로 열어서 아래 코드를 추가 후

XE 관리자 패널 > 일반 > 고급 > 짧은 주소 사용을 활성화합니다.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="가져온 규칙 1" stopProcessing="true">
                    <match url="^(layouts|m.layouts)/(.+)\.html$" ignoreCase="false" />
                    <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
                </rule>
                <rule name="가져온 규칙 2" stopProcessing="true">
                    <match url="/(skins|m.skins)/(.+)\.html$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{URL}" pattern="/modules/editor/" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
                </rule>
                <rule name="가져온 규칙 3" stopProcessing="true">
                    <match url="^(modules|addons|widgets)/(.+)/(conf|queries|schemas)/(.+)\.xml$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php" />
                </rule>
                <rule name="가져온 규칙 4" stopProcessing="true">
                    <match url="^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="./files/{R:2}/{R:3}" />
                </rule>
                <rule name="가져온 규칙 5" stopProcessing="true">
                    <match url="^(.+)/(files|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="./{R:2}/{R:3}" />
                </rule>
                <rule name="가져온 규칙 6" stopProcessing="true">
                    <match url="^(rss|atom)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?module=rss&act={R:1}" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 7" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/(rss|atom|api)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?mid={R:1}&act={R:2}" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 8" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?vid={R:1}&mid={R:2}&act={R:3}" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 9" stopProcessing="true">
                    <match url="^([0-9]+)/(.+)/trackback$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?document_srl={R:1}&key={R:2}&act=trackback" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 10" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?mid={R:1}&document_srl={R:2}&key={R:3}&act=trackback" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 11" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?vid={R:1}&document_srl={R:2}&key={R:3}&act=trackback" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 12" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?vid={R:1}&mid={R:2}&document_srl={R:3}&key={R:4}&act=trackback" appendQueryString="false" />
                </rule>
                <rule name="가져온 규칙 13" stopProcessing="true">
                    <match url="^([0-9]+)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?document_srl={R:1}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 14" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="./index.php?mid={R:1}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 15" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([0-9]+)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?mid={R:1}&document_srl={R:2}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 16" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="./index.php?vid={R:1}&mid={R:2}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 17" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?vid={R:1}&mid={R:2}&document_srl={R:3}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 18" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/entry/(.+)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?mid={R:1}&entry={R:2}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 19" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$" ignoreCase="false" />
                    <action type="Rewrite" url="./index.php?vid={R:1}&mid={R:2}&entry={R:3}" appendQueryString="true" />
                </rule>
                <rule name="가져온 규칙 20" stopProcessing="true">
                    <match url="^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="./index.php?act=route&vid={R:1}&type={R:2}&identifier={R:3}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

 

 

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.