안녕하세요~


윈도우 서버 2008의 IIS 7.5 환경에서 루트에 XE로 한국어 사이트를 구축하고  seoul이라는 섭폴더에 줌라로 영문 사이트를 깔았습니다.

문제는 줌라의 rewrite rule이 상위의 XE web.config 파일로 인해 제대로 작동을 하지 않는데요.

예전에 한 지인께서

 <location path="." inheritInChildApplications="false">

 </location>

를 루트에 있는 web.config에 넣으면 된다고 해서 적용해서 잘 쓰고 있었습니다.


이때는 루트에 줌라가 깔려있고 섭폴더에 XE가 깔려져있었구요.


문제는 제가 정확히 어디에 

 <location path="." inheritInChildApplications="false">

 </location>

를 넣어야 하는지를 몰라서 나름 해봤더니 에러가 나서 고수님들의 도움을 좀 구하려고 이렇게 글을 남깁니다.


루트에 있는 XE의 web.config 내용은

아래와 같습니다. 여기에도 webconfig.zip


<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <configSections>
    <sectionGroup name="system.webServer">
      <sectionGroup name="rewrite">
        <section name="rewriteMaps" overrideModeDefault="Allow" />
        <section name="rules" overrideModeDefault="Allow" />
      </sectionGroup>
    </sectionGroup>
  </configSections>

  <system.webServer>
    <defaultDocument>
      <files>
        <remove value="index.php" />
        <add value="index.php" />
      </files>
    </defaultDocument>

    <rewrite>
      <rules>
        <!--# reserve XE Layout Template Source File (*.html)-->
        <rule name="Imported Rule 1" stopProcessing="true">
        <match url="^layouts/(.+)/(.+)\.html$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
        <match url="^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*)" ignoreCase="false" />
        <conditions>
        <!--# static files-->
        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        </conditions>
        <action type="Rewrite" url="./files/{R:2}/{R:3}" />
        </rule>
        <rule name="Imported Rule 3" stopProcessing="true">
        <match url="^(\w+)(/\w+(/entry)?)?/(files|modules|common|widgets|widgetStyle|layouts|addons)/(.*)" ignoreCase="false" />
        <conditions>
        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        </conditions>
        <action type="Rewrite" url="./{R:4}/{R:5}" />
        </rule>
        <!--# rss , blogAPI-->
        <rule name="Imported Rule 4" 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="Imported Rule 5" stopProcessing="true">
        <match url="^(\w+)/(rss|atom|api)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?mid={R:1}&amp;act={R:2}" appendQueryString="false" />
        </rule>
        <rule name="Imported Rule 6" stopProcessing="true">
        <match url="^(\w+)/(\w+)/(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>
        <!--# trackback-->
        <rule name="Imported Rule 7" stopProcessing="true">
        <match url="^(\d+)/(.+)/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="Imported Rule 8" stopProcessing="true">
        <match url="^(\w+)/(\d+)/(.+)/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>
        <!--# administrator page-->
        <rule name="Imported Rule 9" stopProcessing="true">
        <match url="^admin/?$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?module=admin" appendQueryString="false" />
        </rule>
        <!--# document permanent link-->
        <rule name="Imported Rule 10" stopProcessing="true">
        <match url="^(\d+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?document_srl={R:1}" appendQueryString="false" />
        </rule>
        <!--# vid + document permanent link-->
        <rule name="Imported Rule 11" stopProcessing="true">
        <match url="^(\w+)/(\d+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?vid={R:1}&amp;document_srl={R:2}" appendQueryString="false" />
        </rule>
        <rule name="Imported Rule 12" stopProcessing="true">
        <match url="^(\w+)/?$" ignoreCase="false" />
        <conditions>
        <!--# mid link-->
        <add input="{SCRIPT_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        </conditions>
        <action type="Rewrite" url="./index.php?mid={R:1}" appendQueryString="false" />
        </rule>
        <rule name="Imported Rule 13" stopProcessing="true">
        <match url="^(\w+)/(\w+)/?$" ignoreCase="false" />
        <conditions>
        <!--# vid + mid link-->
        <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="false" />
        </rule>
        <!--# mid + document link-->
        <rule name="Imported Rule 14" stopProcessing="true">
        <match url="^(\w+)/(\d+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?mid={R:1}&amp;document_srl={R:2}" appendQueryString="false" />
        </rule>
        <!--# vid + mid + document link-->
        <rule name="Imported Rule 15" stopProcessing="true">
        <match url="^(\w+)/(\w+)/(\d+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?vid={R:1}&amp;mid={R:2}&amp;document_srl={R:3}" appendQueryString="false" />
        </rule>
        <!--# mid + entry title-->
        <rule name="Imported Rule 16" stopProcessing="true">
        <match url="^(\w+)/entry/(.+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?mid={R:1}&amp;entry={R:2}" appendQueryString="false" />
        </rule>
        <!--# vid + mid + entry title-->
        <rule name="Imported Rule 17" stopProcessing="true">
        <match url="^(\w+)/(\w+)/entry/(.+)$" ignoreCase="false" />
        <action type="Rewrite" url="./index.php?vid={R:1}&amp;mid={R:2}&amp;entry={R:3}" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>

</system.webServer>
    <system.net>
        <mailSettings>
            <smtp from="">
                <network host="" />
            </smtp>
        </mailSettings>
    </system.net>

</configuration>


그리고 섭포러의 줌라의 web.config는

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
                        <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
                        <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
                        <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
                        <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
                    </conditions>
                    <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
                </rule>
                <rule name="Imported Rule 2">
                    <match url="(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{URL}" pattern="^/index.php" ignoreCase="false" negate="true" />
                        <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

됩니다.


집파일도 첨부할께요~


지금 작동중인 사이트는

http://www.enjoyitaewon.com

이구요.


섭폴더에 작동하고 있는 줌라는

http://enjoyitaewon.com/seoul/

이고 지금 현재 rewrite rule web.config는 삭제해 놓아서 friendly url이 안 돌아가고 있는 중입니다.


도움에 미리 감사드립니다~~~

webconfig.zip