• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to get back .cfm extension to requesting url

Community Beginner ,
May 03, 2019 May 03, 2019

Copy link to clipboard

Copied

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>

Views

250

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation