1

I am looking to redirect

somewebsite.tld/oldpage.cfm?Query=505050

to

somewebsite.tld/New?ref=505050

I've done the following

In web.config I've added a handler to handle the .cfm request

<system.webServer>
 <handlers>
  <add name="ColdFusion" path="*.cfm" verb="*" type="System.Web.StaticFileHandler" resourceType="Unspecified" preCondition="integratedMode" />
 </handlers>
</system.webServer>

I've added the following ewrite rule but it does not work.

<rewrite>
 <rules>
  <rule name="Redirect oldpage.cfm" stopProcessing="true">
   <match url="oldpage\\.cfm(\\?(\\w+)=(\\d+))" /> <action type="Redirect" url="New?ref={R:3}" appendQueryString="false" redirectType="Permanent" />
  </rule>
 </rules>
</rewrite>

I was able to use a urlmapping to at least read a request from /View with the following rule.

<system.web>
 <urlMappings>
  <add url="~/oldpage.cfm" mappedUrl="~/New" />
 </urlMappings>
</system.web>

However this still does not grab the query string.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
kiamori
  • 11
  • 1
  • not sure why stackoverflow editor added the extra code but the rewrite rule I have is – kiamori Jun 25 '19 at 22:35
  • You cannot match against query string via ``, check `` instead. [Here is a related question on SO.](https://stackoverflow.com/questions/19165676/iis-url-rewrite-not-working-with-query-string) – Alex Jun 25 '19 at 22:45

0 Answers0