Skip to main content
Participant
May 3, 2019
Question

How to get back .cfm extension to requesting url

  • May 3, 2019
  • 0 replies
  • 336 views

At First, I tried to Request my page without cfm extension using IIS Url rewrite module and I have succeeded. Now, I want to get back my .cfm extension to the requested url. I changed my web.config file as before and uninstalled url rewrite module, few pages in my website are accessing with .cfm extension and few are throwing "HTTP Error 404.0 - Not Found" even though the file exists.

Error code - 0x80070002

------------------------------------------------------

I have used this for rewriting

---------------------------------------------------------

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

----------------

web.config

------------------

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

This topic has been closed for replies.