Getting rid of aspx extension?

December 13, 2005 | Uncategorized | 2 Comments

We’re building a new CMS that tries to do away with any *.aspx ending so that we have prettier URLs that are more “hackable” (Jakob Neilson’s term). In IIS, we route all requests through ASP.NET and then impliment a StaticFileHandler for images, css, javascript, etc. and a custom HandlerFactory to build our pages from the DataStore. But doing this means that all *.aspx, *.ashx, and *.asmx files no longer work.

To re-enable *.aspx, *.ashx, and *.asmx, and ASP.NET 2.0 AssemblyResources, just add the following lines to your web.config:

<httpHandlers>
<add path=”WebResource.axd” verb=”GET” type=”System.Web.Handlers.AssemblyResourceLoader” validate=”true”/>
<add path=”*.aspx” verb=”*” type=”System.Web.UI.PageHandlerFactory” />
<add path=”*.asmx” verb=”*” type=”System.Web.Services.Protocols.WebServiceHandlerFactory” />
<add path=”*.ashx” verb=”*” type=”System.Web.IHttpHandlerFactory” />
<add verb=”*” path=”*” type=”YourNamespace.YourCustomHandlerFactory, YourAssemblyName”/>
</httpHandlers>

This really just shows the classes that impliment IHttpHandlerFactory which makes things a million times easier than in ASP.NET 1.x.

2 responses to “Getting rid of aspx extension?”

  1. Mojtaba Vali says:

    hi
    is there a flash player standalone(not customized for blogengine)?
    thanks
    Mojtaba Vali From VestaSoft.ir

  2. hi
    thanks its very good and very nice.

Leave a Reply

Hi, I'm John Dyer. In my day job, I build websites and create online seminary software for a seminary in Dallas. I also like to release open source tools including a pretty popular HTML5 video player and build tools that help people find best bible commentaries and do bible study. And just for fun, I also wrote a book on the theology of technology and media.

Fork me on GitHub

Social Widgets powered by AB-WebLog.com.