Archived content - go to the new site here

Flat urls in umbraco

31. oktober 2006 by Kasper B

Configuring flat-urls in umbraco requires a change in the web.config change and a configuration change in your IIS

First off - locate the <add key="umbracoUseDirectoryUrls" value="false"/> in the web.config files appSettings region, and change it's value to "true", this will make umbraco's niceurl component generate flaturls (without the .aspx) and configure the httphandler to listen for urls without the .aspx postfix

The second part is to configure your IIS, so your favorite .NET engine is responsible for handling all requests, take a look here for configuring IIS6 Installing Wildcard Application Mappings (IIS 6.0) (microsoft)

Note you neeed to disable "Verify that file exists" since umbraco simulates a physical file structure, and does not maintain the structure on the filesystem

You are now not able to use the url http://[yourwebsite]/umbraco to access umbraco, use http://[yourwebsite]/umbraco/default.aspx instead

4 comment(s) for “Flat urls in umbraco”

  1. dj_uncas Says:
    Sounds cool..

    But i gues you could still be able to use the /umbraco/ url? If you create a new IHttpHandler that handles requests for /umbraco/ and put it before the one handling umbraco flat url's this should be possible. The new IhttpHandler should then do nothing but redirect to /umbraco/default.aspx or whatever...
  2. Rusty Says:
    Oh my! you just sold me! Thank you so much for building this. I'll let you know how the first implementation goes
  3. Chance Says:
    There is an alternative to having IIS handle wildcards.

    I haven't taken a look under the hood but I am guessing all of the engine pumping redirecting fury is being generated by the Global.

    What you could do instead is upon URL request, is simply write a blank default.aspx file. That alone would trigger IIS to render the file as a .net app.

    I am just getting started with Umbraco but I should be up to speed relatively soon and I'll write it out once I am :).
  4. SC Website Design Says:
    Wow I so did not see that date until after I hit submit.. I'm sure theres already a solution out there by now.

Name:
E-mail:
(not shown)
Website:
(optional - remember http://)
Comment:
I *HEART* spam: