Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IIS7 URL重写规则,用于执行从*.html文件到*.php文件的301重定向_Iis_Iis 7_Url Rewriting - Fatal编程技术网

IIS7 URL重写规则,用于执行从*.html文件到*.php文件的301重定向

IIS7 URL重写规则,用于执行从*.html文件到*.php文件的301重定向,iis,iis-7,url-rewriting,Iis,Iis 7,Url Rewriting,我想使用IIS7的URL重写模块基于特定模式创建301重定向 我有一个只包含.HTML文件的网站。我正在将站点转换为.PHP文件,但保留所有相同的文件名。例如,以下URL /index.html /contact/contact.html /membership/member.html 将成为 /index.php /contact/contact.php /membership/member.php 有人能就如何创建此规则提供建议吗 谢谢。给你: <system.webServer&

我想使用IIS7的URL重写模块基于特定模式创建301重定向

我有一个只包含.HTML文件的网站。我正在将站点转换为.PHP文件,但保留所有相同的文件名。例如,以下URL

/index.html
/contact/contact.html
/membership/member.html
将成为

/index.php
/contact/contact.php
/membership/member.php
有人能就如何创建此规则提供建议吗

谢谢。

给你:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="html2php" stopProcessing="true">
                <match url="^(.+)\.html$" />
                <action type="Redirect" url="{R:1}.php" redirectType="Permanent" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>


在带有URL重写模块v2.0的IIS 7.5上进行了测试——工作正常。

仍在完成该站点。将有它在几天内运行,然后我会得到的URL重写工作。我会让你知道的;我保证。