在Web.Config中将Coldfusion转换为.NET页面.cfm到.aspx

时间:2014-08-11 19:15:52

标签: asp.net redirect coldfusion iis-7.5

通过web.config为Coldfusion页面创建重定向到.Net页面。寻找有关处理.cfm请求并在IIS 7.5的Windows服务器上将它们转换为.aspx的指导。理想情况下,301重定向用于搜索引擎优化目的。

任何人都知道一种有效的方法来处理.cfm请求并通过web.config将它们转换为.aspx吗?

2 个答案:

答案 0 :(得分:4)

我在IIS 7.5和8上使用Coldfusion 9.x.x,这就是我们的工作。

假设您有一个如下所示的链接:

http://example.com/index.cfm?articleid=12&displayText=title-of-the-article

您需要将此基本结构添加到您的web.config文件中:

<rewrite>
    <rules>
        <rule name="Article Stripper" stopProcessing="true">
            <match url="^([\w-_+]+)/([\w-_+]+)" ignoreCase="false" />
            <action type="Rewrite" url="/index.cfm?articleid={R:1}&amp;displayText={R:2}" appendQueryString="true" />
        </rule>             
    </rules>
</rewrite>

制作类似的内容:

http://example.com/12/title-of-the-article

答案 1 :(得分:0)

您可以在Global.asax中使用Application_BeginRequest()事件。

有关详细信息,请查看以下链接。

Asp.net processing of .CFM files or Redirects from .cfm to .aspx page

相关问题