How to have .net application to use the .html extension instead of .aspx?

Please try to update in your web.cofig file:

 

<configuration>
    <system.web>
      <httpHandlers>
          <remove verb="*" path="*.html" />
          <add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory" />
      </httpHandlers>
      <compilation>
         <buildProviders>
            <add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
         </buildProviders>
      </compilation>
   </system.web>
   <system.webServer>
	<handlers>
		<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit-html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
		<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit-html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
		<add name="ExtensionlessUrlHandler-Integrated-4.0-html" path="*.html" verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
	</handlers>
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>

</configuration> 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SQL server- network related or instance-specific error happened while connection establishing

  Instance-specific or network related error happening while connecting to SQL server   Please...

OleDB connection string examples

OleDB connection string examples MS Access (Jet) "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA...

Do you allow custom COM components?

Do you allow custom COM components? We are not offering to install the custom COM components...

Error when accessing a WCF services

Error when accessing a WCF services Error when accessing a WCF service: "IIS specified...

How to cache static contents to client with UseMaxAge?

You can consider to caches static contents to the client with UseMaxAge if your website has too...

Powered by WHMCompleteSolution