kingjtiv
kingjtiv

Reputation: 153

Coldfusion to .NET pages .cfm to .aspx in Web.Config

Creating redirects for Coldfusion pages to .Net pages through web.config. Looking for guidance on handling .cfm request and converting them to .aspx on a windows server with IIS 7.5. Ideally 301 redirects for SEO purposes.

Anyone know an efficient way to handle .cfm request and convert them to .aspx through web.config?

Upvotes: 0

Views: 740

Answers (2)

Frank Tudor
Frank Tudor

Reputation: 4534

I work with Coldfusion 9.x.x on IIS 7.5 and 8 and here is what we do.

Say you have a link that appears like this:

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

You'll need this basic structure added to your web.config file:

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

To produce something like this:

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

Upvotes: 4

PratikDotCa
PratikDotCa

Reputation: 174

You can do using Application_BeginRequest() event in Global.asax.

Please check out following link for further details on it.

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

Upvotes: 0

Related Questions