How to enable Umbraco directory URLs without needing a wildcard mapping in IIS

November 24th, 2006 | Tags: ,

If for some reason you cannot create an wildcard mapping to ASP.net in IIS, but would still like to have directory URLs in Umbraco there is another way. You can use ISAPI_rewrite (or a similiar tool) to rewrite requests to an extension that is handled by ASP.net. Here are the ISAPI_rewrite rules I use to accomplish this for JLCoady.net:

RewriteRule /data/.* / [F,I,O]
RewriteRule /(umbraco|reports).* $& [L]
RewriteRule / $& [L]
RewriteRule ([^.?]*)(\?.+)? $1.aspx$2

The first rule blocks access to the contents of the data directory.

The second rule bypasses umbraco handling for certain paths; this should be the same as umbracoReservedUrls and umbracoReservedPaths in your web.config.

The third rule makes root access work, otherwise requests made to ‘/’ would be rewritten to ‘/.aspx’.

Now that all of the non-standard cases have been handled, the fourth rule takes all requests to directories (no file extension) and rewrites them with an aspx file extension so they will be handled by ASP.net.

No comments yet.

TOP