We help IT Professionals succeed at work.
Get Started

Map IIS 8.5 / Coldfusion 11 to process .htm files same as .cfm files.

1,353 Views
Last Modified: 2016-09-26
I've tried several suggestions I found on the net to change web.xml and other files, stop cf, then start again, but nothing seems to work.
Search engines have indexed important .htm files so I'm not about to change them to .cfm just to get the system to work. There must/should be a very simple way to do this, hopefully.

So, how can I map all my .htm files to act just as though they were .cfm. I tried using IIS 8.5's Handler Mappings. If that this is the solution then I must not understand the process and really
need detailed help because it did not work.

I'm using ColdFusioin 11 on Windows Server 2012 R2.

For a workaround I used the IIS ReWrite tool. Here's the contents of my "web.config" file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <system.webServer>
      <defaultDocument enabled="true">
         <files>
            <add value="home.cfm" />
         </files>
      </defaultDocument>
        <rewrite>
            <rules>
             <rule name="Redirect htm to cfm" stopProcessing="true">  
  <match url="(.*).htm$" />  
  <action type="Redirect" redirectType="Permanent" url="{R:1}.cfm" />  
</rule>  
            </rules>
        </rewrite>
   </system.webServer>
</configuration>

But of course, this forced me to create a corresponding cfm file for every htm file. But it does work.

So, hoping someone will show me exactly how to get htm files to render just like cfm files which was quite easy to do back in CF8 and IIS6.
Comment
Watch Question
Cloud Security Consultant
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE