-1

.htaccessファイルをに変換したいweb.config

ここにコードがあります

AddType application/x-httpd-php .html
RewriteEngine on

RewriteBase /

RewriteCond %{Request_Filename} !-d
RewriteCond %{Request_Filenam}e !-f

RewriteRule ^pages/([0-9A-Za-z_\-~',]+) page_details.html?category_page_title=$1 [NC]

この .htaccess ファイルを web.config ファイルに変換するのを手伝ってくれる人はいますか?

前もって感謝します。

4

1 に答える 1

3

.htaccessファイル全体の変換については 、このマニュアルを参照してください: http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

それはかなり包括的で、ルールを変換する方法を説明しています。


リライト ルールを変換するだけの場合は、次の記事をお読みください: http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/

これはより段階的な GUI のようなガイドですが、あなたの場合はおそらくそれで十分でしょう。


いずれにせよ、あなたがリストしたルールはおそらくこれ(の一部)で終わるでしょうweb.config

    <rewrite>
        <rules>
            <rule name="page details" stopProcessing="true">
                <match url="^/pages/([0-9A-Za-z_\-~',]+)" ignoreCase="true" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                </conditions>

                <action type="Redirect" redirectType="Permanent" url="/page_details.html?category_page_title={R:1}" />
            </rule>
        </rules>
    </rewrite>
于 2012-07-25T10:47:47.963 に答える