허당 레몬도리

 서버 구성

iis 7, php 5.6.5, mysql 으로 사용되고 있는 서버를 이용해 개발을 하던 중 운영 서버파일을 백업 받아 개발 서버에 복원하는 과정에서 문제가 발생하였다.

발생한 문제는 xe의 게시판 주소로 접근이 불가능, 게시판에서 불러와야하는 이미지, 글 등이 불러와지지 않는 문제가 발생

전에 개발했던 사람에게 정보 공유 없이 오류를 찾다보니 시간만 계속 보내던 중 web.config안에 설정들이 있는 것을 대수롭지 않게 봤다. 이것만 제대로 봤더라면 시간 낭비가 줄었을텐데 말이다.  

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="false" />
        <defaultDocument>
            <files>
                <add value="index.php" />
            </files>
        </defaultDocument>
        <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&amp;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}&amp;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}&amp;mid={R:2}&amp;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}&amp;key={R:2}&amp;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}&amp;document_srl={R:2}&amp;key={R:3}&amp;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}&amp;document_srl={R:2}&amp;key={R:3}&amp;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}&amp;mid={R:2}&amp;document_srl={R:3}&amp;key={R:4}&amp;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}&amp;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}&amp;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}&amp;mid={R:2}&amp;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}&amp;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}&amp;mid={R:2}&amp;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&amp;vid={R:1}&amp;type={R:2}&amp;identifier={R:3}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
        <staticContent>
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
        </staticContent>
    </system.webServer>
</configuration>
 

 

뭐에 쓰이는 놈인지 궁금해 검색하던 중 유투브 동영상 한개를 발견하였다.  

http://www.youtube.com/watch?v=trh54g88NbE 

이게 무엇인가. iis에서 사용할 수 있는 모듈이 있었던 것이다. 

IIS 7용 Microsoft URL 재작성 모듈 2.0(x86) :

http://www.microsoft.com/ko-kr/download/details.aspx?id=5747

IIS 7용 Microsoft URL 재작성 모듈 2.0(x64) :

http://www.microsoft.com/ko-kr/download/details.aspx?id=7435 

위 파일을 설치 후 페이지 로드에 이상이 없었다.

이게 뭔 삽질이람.

URL이 바뀔까 파일 첨부해 둠.

rewrite_x86_ko-KR.msi

profile

허당 레몬도리

@LemonDory

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!