At first, I tried to request my pages without a .cfm extension, using the IIS URL rewrite module and was successful. Now, I want to get back my .cfm extension to the requested URL. 
I changed my web.config file as before and uninstalled the URL rewrite module. A few pages in my website are accessed with a .cfm extension and are throwing this error, even though the file exists: 
HTTP Error 404.0 - Not Found , Error code - 0x80070002
<rewrite>
  <rules>
    <rule name="Hide .cfml ext">
      <match url="^(.*)" ignoreCase="true" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{REQUEST_FILENAME}.cfml" matchType="IsFile" />
      </conditions>
      <action type="Rewrite" url="{R:0}.cfml" />
    </rule>
    <rule name="Redirecting .cfml ext" stopProcessing="true">
      <match url="^(.*).cfml" />
      <conditions logicalGrouping="MatchAny">
        <add input="{URL}" pattern="(.*).cfml"  />
      </conditions>
      <action type="Redirect" url="{R:1}" />
    </rule>
  </rules>
</rewrite>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="true" />
        <defaultDocument>
            <files>
                <clear />
            <add value="index.cfm" />
                <add value="home.cfm" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
                <add value="default.aspx" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>
User contributions licensed under CC BY-SA 3.0