Welcome to Professional ASP.NET - Chris Love's Official Blog Sign in | Join | Help

Chris Love's Official ASP.NET Blog

Chris Love's Helpful tips, tricks and pragmatic development knowledge for the ASP.NET world.
ASP Insider

Microsoft Store

Configure IIS for Wildcard Extensions in ASP.NET

I get asked this question a lot as I go around demonstrating the benefits of using URL Rewriting in ASP.NET, how can I process wildcard extensions and just directories in IIS 6.0 on Windows 2003 and ASP.NET? It is very simple, but not obvious at all. This entry will walk you through configuring IIS to process all request through the ASP.NET engine.

The first thing you must have is access to the IIS Management console and Administrator privileges to the web server. Once you have these things in place you need to open the properties dialog for the Web site you will be configuring.

IIS Web Site Properties Dialog

IIS Web Site Properties Dialog

Select the 'Home Directory' tab. Once on this tab select the 'Configuration' Button. This will display a three tab dialog, the first tab, Mappings is what we are interested in. Notice the lower portion of the tab list 'Wildcard Application Maps', here we will want to add a reference to the ASP.NET engine. The easy way to do this is to double click on one of the ISAPI extensions in the top portion and copying the path to the ASP.NET .dll file. You will need to select one of the ASP.NET file extensions, like .ascx or .asax to do this. The path should look something like this: DRIVE:\%windows%\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll.

IIS Web Site Configuration Dialog

IIS Web Site Configuration Dialog

Now that we have copied the path to the .NET engine we need to add it to the Wildcard mappings. Select the Insert button to the right of the mappings list. Now you will have an Add/Edit Application Extension Mapping dialog displayed. There are two pieces of information you need to supply, the ASP.NET engine path and uncheck 'Verify File Exists'. Now select 'OK' until all the property windows are closed.

IIS Wildcard Application Extension Mapping Dialog

IIS Wildcard Application Extension Mapping Dialog

Now all URL requests to the web site will be processed by ASP.NET no matter what the extension or lack of extension. Pay attention for my next entry on how to leverage this feature to map URLs without extensions to actual dynamic pages on your Web site.

Reference - Installing Wildcard Mappings in IIS 6.0

kick it on DotNetKicks.com

Posted: Friday, July 27, 2007 9:49 PM

by Chris Love
Filed under: ,

Comments

Chris Love's Official Blog - Professional ASP.NET said:

Back in July I made a post about configuring IIS to handle Wildcard mapping through ASP.NET . I promised

# September 3, 2007 1:33 PM

Chris Love's Official Blog - Professional ASP.NET said:

Back in July I made a post about configuring IIS to handle Wildcard mapping through ASP.NET . I promised

# September 3, 2007 1:34 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# September 4, 2007 2:14 PM

Chris Love's Official Blog - Professional ASP.NET said:

To continue with my series on httpHandlers I want to cover how to stream a vCard to the user based on

# September 23, 2007 8:23 PM

Frank said:

Could you direct me to your post regarding: "Pay attention for my next entry on how to leverage this feature to map URLs without extensions to actual dynamic pages on your Web site."? Thanks!
# June 26, 2008 10:27 AM

Chris Love said:

Ahh, I did do it! http://professionalaspnet.com/archive/2007/07/27/Create-an-HttpModule-to-Process-Wildcard-Extension-Mapping-in-ASP.NET.aspx
# June 27, 2008 12:50 AM

Sandro Klostermann said:

Hi. I have a blog in Portuguese where I post about tools and ideas for developers who use Microsoft Visual Studio, ASP.NET, SQL Server, etc. I found this post and it's complementary to one entry I'm posting today (Jul/06). I'd like to have your permission to translate this entry and post it in my blog too. Thanks for your attention. Cheers!
# July 6, 2008 7:52 PM

Chris Love said:

Please do!!! Just let me know the URL so I can pass it along to some folks there and S. America. Fantastic.

# July 7, 2008 6:22 PM

Christopher Bennage said:

So we've been working on a web project for a friend's startup company (I don't like doing

# September 25, 2008 11:59 AM

Community Blogs said:

So we've been working on a web project for a friend's startup company (I don't like doing

# September 25, 2008 12:23 PM

otreians said:

You've been kicked (a good thing)
# November 1, 2008 3:39 PM

Natalie said:

I have followed these steps exactly but it does not seem to work. If I enter a filename (with or without extension) which does not end in .aspx, the regular iis 404 message appears and not the aspx missing resource page. So it does not get invoked. Any ideas how to fix it?
# December 2, 2008 2:03 PM

seifolah said:

Hi Chris. Thank's It's so helpFul.
# February 11, 2009 12:27 AM

Josh said:

Thanks. I knew I didn't have to create a custom http handler to block hotlinking
# July 10, 2009 11:48 AM

vinayak said:

You just rock. Thanks a lot. This solution has worked for me for IIS 6.0. You could probably use URLMapping in your blog title so that it gets listed in the search results. :)
# August 17, 2009 2:53 AM

Hitesh Sharma said:

hey Chris, I am runing my application on a shared server,where I do not have access to iis console.What should I do in that case?
# September 3, 2009 1:42 AM

Chris Love said:

Hitesh,

You have to have this sort of access to the server to map all requests through ASP.NET. You can do this on a site by site setting in IIS 7, but I don't remember in IIS 6.0. I think it too was possible.

# September 6, 2009 9:04 PM

Stanly said:

Hi i'm using Intelligencia.UrlRewriter.dll... its working fine when i use view browser...its no at all working in local IIS and Server... Help me...
# October 7, 2009 7:34 AM

Rick said:

Chris, I've been trying to get my new SEO-friendly URLs working on IIS for about a day. Then I ran across your two-year-old blog and I had it all running in a couple of minutes. My wildcard mapping wasn't set up right. Thanks! Rick
# October 7, 2009 12:23 PM

Amber said:

This was exactly the fix I needed. The URL mapping had been working locally, but not on my server, but this fixed it. Thanks!
# October 15, 2009 2:12 PM

liberana said:

thanks a lot!!, it works!! ^^

# May 17, 2010 1:05 PM

Prmaod said:

Please let me know how to use this feature to map URLs without extensions to actual dynamic pages on your Web site.
# January 10, 2011 11:56 PM

kr prasad said:

Please give me solution for following problem. I followed same method you described above for Wildcard Extensions in ASP.NET. And Everything worked fine as expected. This configured application was having a file : product.aspx and url rewrite: products The problem occured when I removed Product.aspx and Created a new file- file products.aspx (note plural form) url rewrite: products (same as above) This time its still looking for product.aspx file and giving error; resource file Product.aspx not found or has been removed etc. I dont know why its looking for the previous file? Any solution? Thanks in advance for help.. Now I
# March 23, 2012 12:08 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS