IIS7 URL重写规则,用于执行从*.html文件到*.php文件的301重定向
我想使用IIS7的URL重写模块基于特定模式创建301重定向 我有一个只包含.HTML文件的网站。我正在将站点转换为.PHP文件,但保留所有相同的文件名。例如,以下URLIIS7 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&
/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重写工作。我会让你知道的;我保证。