我想转换的.htaccess文件的web.config [英] I want to convert .htaccess file to web.config

查看:283
本文介绍了我想转换的.htaccess文件的web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要转换的.htaccess 文件到的web.config

下面是code

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文件。

Can anybody help me to convert this .htaccess file to web.config file.

在此先感谢。

推荐答案

对于转换整个的.htaccess 的文件,请参阅本手册:的http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

Regarding conversion of whole .htaccess file, see this manual: http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

这是pretty的COM prehensive,并解释如何将这些规则。

It is pretty comprehensive and explains how to convert the rules.

如果你只想重写转换规则,请阅读这篇文章: http://learn.iis.net/page.aspx/ 470 /进口-Apache的modrewrite-规则/

If you want just rewrite rules converted, read this article: http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/

这是一个更一步一步的GUI好心的向导,但在你的情况下,它应该是足够的。

This is a more step-by-step gui kind of guide, but in your case it should probably be enough.

在任何情况下,你列出的规则最终可能会与此(部分)的web.config

In any case, the rules you listed will probably end up with this (portion of) 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>

这篇关于我想转换的.htaccess文件的web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆