Is it bad that I just acheived inbox-zero by deleting all my emails?

follow me on

The importance of umbracoReservedUrls in your Umbraco web.config

Monday, August 04, 2008 by David Conlisk

Sometimes you want to have a normal .aspx page in your Umbraco site that you would like to function as a normal page (i.e. doesn't get served by Umbraco). If you do, don't forget to update your umbracoReservedUrls setting in the web.config.

To allow a standalone .aspx page to function as normal, let Umbraco know that it shouldn't interfere with requests for that page by adding it to the umbracoReservedUrls in the web.config. If you don't, you'll get the nasty Umbraco "Page not found - No umbraco document matches the url 'http://localhost/default.aspx?umbPage=/whatever.aspx' page.

The default.aspx page in Umbraco is the page that shows this lovely error. When you request a node that Umbraco can't find, you get bumped to this page. In my case, I'd deleted the default.aspx page by mistake because I was copying across .aspx pages from my UserControls web application project. My post-build event was copying across all .aspx pages, including one called Default.aspx (this is created for you when you create a new project in Visual Studio). I didn't need the default.aspx page, so I deleted it. Ha! 

So now I'm requesting my whatever.aspx page. Umbraco doesn't know to ignore the request because I haven't set the umbracoReservedUrls setting. It tries to bump me to the default.aspx page - which doesn't exist. So I get a 404 on default.aspx, and I can't work out why! 

I couldn't for the life of me work out why it was trying to request /default.aspx, but in the end I updated the umbracoReservedUrls setting in the web.config to include the url of my non-Umbraco .NET page and now it's fine. I also copied back in the original default.aspx page, and now everything works as expected.

Hopefully that'll save someone else some hair-pulling!

David

Bookmark and Share

3 comment(s) for “The importance of umbracoReservedUrls in your Umbraco web.config”

  1. Gravatar of Jay Greasley


    Jay Greasley says:

    Cool, so you can have standard web apps functionality within your umbraco site? Do you know if you can also access the post data from umbraco in the aspx page??
  1. Gravatar of Warren Buckley


    Warren Buckley says:

    An interesting experience you had there, and a useful lesson to anyone else new to Umbraco.

    Yes as the umbraco nodes/urls don't physically exist on the server they all run through the default.aspx page with some wondeful magic that Niels and the guys have done.

    Warren
  1. Gravatar of Hartvig


    Hartvig says:

    That's work as expected, but maybe we should make it much clearer. Umbraco registers a httpmodule in the web.config that looks at all incoming requests ending with .aspx and tries to match those with a node in your tree, if not it'll throw a 404. That's also why all the notes that magically respons to .aspx extensions doesn't exists as flat files.

    Thanks for sharing your experiences! This blog is turning out great!

Please leave a comment: