【问题标题】:Coldfusion to .NET pages .cfm to .aspx in Web.ConfigColdfusion 到 .NET 页面 .cfm 到 Web.Config 中的 .aspx
【发布时间】:2014-10-04 17:17:04
【问题描述】:

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

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

【问题讨论】:

  • 如果您提出具体问题,您可以找到指导,Grasshopper。
  • 可能更适合ServerFault
  • 您能否将您的问题扩充为由语法正确且易于理解的句子组成,并提出一个具体问题。但我倾向于同意 Scott:这听起来不像是编程问题,而是服务器配置问题。

标签: asp.net redirect coldfusion iis-7.5


【解决方案1】:

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

请查看以下链接以获取更多详细信息。

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

【讨论】:

    【解决方案2】:

    我在 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

    【讨论】:

      猜你喜欢
      • 2012-05-15
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      • 2021-02-21
      • 2019-05-21
      • 1970-01-01
      相关资源
      最近更新 更多