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?
I work with Coldfusion 9.xx 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}&displayText={R:2}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
To produce something like this:
http://example.com/12/title-of-the-article
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.