Link to home
Start Free TrialLog in
Avatar of JDEE8297
JDEE8297Flag for United States of America

asked on

mapping .htm or .html to run as .asp files in iis .75

I am trying to get a site that has .htm extensions but executes asp code with in the pages, as it was set up to execute .htm as .asp files witin IIS. This was originally running on a Windows 2003 server, but I have moved it to Windows2008.

So any help you can give on this would be appreciated. Thanks.
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

In the properties for the site, on the Home Directory tab, click the Configuration... button.  On the Mappings tab, Add a mapping for .htm that points to the same handler .asp files are configured to use.
Avatar of JDEE8297

ASKER

not sure if what you called out was for IIS 6 or IIS 7.5, it has been a while since I was in IIS 6.0 admin. I am working with IIS 7.5, and the closest thing to the Home Directory tab that you called out is Handler Mappings, and I added in setting for it and no luck.
Right idea, but perhaps the wrong implementation.  Try the process here:
http://www.amixa.com/blog/2011/03/31/iis-7-and-iis-7-5-script-map-htm-to-asp-dll/

tried that one as well, either I am not doing it right or that was for a different problem from mine. Although, it does look the same, but when I tried it.....it kind of broke other stuff and didn't actually work for my problem.
Are your restarting IIS/AppPools after making the change?  Admittedly, this isn't something I've done, but I've heard of people successfully doing it.
I will give it a try later on, but I did do a IISreset on the server when I tried my changes....I will have better luck with it later on today, as it is adevelopment server and people are using it internally. Later on tonight, it will just be me on it.
okay.......here is where I am thinking I am not doing this right, if my site name in IIS is site1.dev.com and the domain for the site1 is site1.dev.com, and I want the htm to map to asp for only this site. What does one put in for location path, every example says Default Web Site, which is the default name which I can see in IIS. I do I put in site1.dev.com or something else?
this is what my config looks like

      <location path="site.devnet.tdomain.com">
                  <system.webServer>
                        <asp appAllowClientDebug="true" scriptErrorSentToBrowser="true" />
                        <handlers>
                              <add name="htm" path="*.htm" verb="*" modules="IsapiModule"      scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="File" />
                        </handlers>
                  </system.webServer>
            </location>
and in the web.config, I can see the following:

<httpHandlers>
                  <add verb="GET, HEAD, POST, DEBUG" path="*.htm" type="System.Web.UI.PageHandlerFactory"/>
                  <add verb="GET, HEAD, POST, DEBUG" path="*.html" type="System.Web.UI.PageHandlerFactory"/>
                  <add verb="GET, HEAD, POST, DEBUG" path="*.asp" type="System.Web.UI.PageHandlerFactory"/>            
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>

really confused as to why it is not working for me.....starting to tick me off
ASKER CERTIFIED SOLUTION
Avatar of JDEE8297
JDEE8297
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this resolved my problem.