3

ColdBoxを使用して構築したサイトがあり、URL から /index.cfm/ を削除しようとしています。以下のweb.configファイルを使用して、IIS7で実行されているColdFusion 9でこれをうまく機能させていますが、CF10/IIS7.5で動作させることはできません。書き換えモジュールがインストールされ、index.cfm (つまり、index.cfm/product/1) を含む SES URL が正常に機能します。CF10 が JRun の代わりに Tomcat で実行されるようになり、すぐに使用できる Tomcat は SES URL をサポートしていないことは知っていますが、私が理解していることから、CF チームはそれらのサポートを明示的に追加しました (実際に web.xml ファイルをチェックすると、これは ColdBox 固有の問題ではなく、CF10/Tomcat と IIS7.5 の間の問題だと思います。

注: Web サーバーに直接アクセスすることはできませんが、ホスティング プロバイダーと連携しています。また、どう考えても私は IIS の専門家ではありません。そして最後に、いいえ、Apache はオプションではありません - 私を信じてください。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <defaultDocument>
        <files>
            <clear />
            <add value="index.cfm" />
            <add value="Default.htm" />
            <add value="Default.asp" />
            <add value="index.htm" />
            <add value="index.html" />
            <add value="iisstart.htm" />
            <add value="default.aspx" />
        </files>
    </defaultDocument>
    <rewrite>
        <rules>
            <rule name="SQL Injection - EXEC" stopProcessing="true">
                <match url="^.*EXEC\(@.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - CAST" stopProcessing="true">
                <match url="^.*CAST\(.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - DECLARE" stopProcessing="true">
                <match url="^.*DECLARE.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - DECLARE%20" stopProcessing="true">
                <match url="^.*DECLARE%20.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - NVARCHAR" stopProcessing="true">
                <match url="^.*NVARCHAR.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - sp_password" stopProcessing="true">
                <match url="^.*sp_password.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="SQL Injection - xp" stopProcessing="true">
                <match url="^.*%20xp_.*$" />
                <action type="CustomResponse" url="/includes/templates/404.html" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
            </rule>
            <rule name="Application Adminsitration" stopProcessing="true">
                <match url="^(.*)$" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{SCRIPT_NAME}" pattern="^/(.*(CFIDE|cfide|CFFormGateway|jrunscripts|railo-context|fckeditor)).*$" ignoreCase="false" />
                </conditions>
                <action type="None" />
            </rule>
            <rule name="Flash and Flex Communication" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{SCRIPT_NAME}" pattern="^/(.*(flashservices|flex2gateway|flex-remoting)).*$" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" url="index.cfm/{PATH_INFO}" appendQueryString="true" />
            </rule>
            <rule name="Static Files" stopProcessing="true">
                <match url="^(.*)$" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{SCRIPT_NAME}" pattern="\.(bmp|gif|jpe?g|png|css|js|txt|pdf|doc|xls)$" ignoreCase="false" />
                </conditions>
                <action type="None" />
            </rule>
            <rule name="RESTful Applications (not working yet)" stopProcessing="true">
                <match url="^(.*)$" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{SCRIPT_NAME}" pattern="^/(.*(rest)).*$" ignoreCase="false" />
                </conditions>
                <action type="None" />
            </rule>
            <rule name="Insert index.cfm" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.cfm/{PATH_INFO}" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>
4

1 に答える 1

1

私が見つけた唯一の回避策は、Helicon などの別の URL リライタをインストールすることでした。

しかし、これは今週末にリリースされた 10.0.1 アップデートで修正されました! http://blogs.coldfusion.com/post.cfm/coldfusion-10-update-1-10-0-1-released

于 2012-09-04T13:03:06.240 に答える