Site Meter
 
 

Overriding IIS6 wildcard maps on individual directories

Many thanks to Duncan Smart whose comment on my previous post about deploying ASP.NET MVC applications to IIS 6 gives us a further option. It turns out that even though IIS Manager only lets you configure wildcard maps on a per-application level, IIS itself allows you to configure them on a per-directory level.

Recap: The goal here is to deploy ASP.NET MVC applications to IIS 6, keeping the clean, extensionless URLs (which requires a wildcard map so that all URLs are processed by ASP.NET, or some tricky URL-rewriting), but without incuring the performance penalty of letting static files get processed by ASP.NET. See the previous post for more details.

So, if you can be disciplined and keep all your static content inside your /Content folder, you can use a normal wildcard map at the root level to get ASP.NET MVC to handle all incoming URLs, even without any “filename extensions” in the URLs, but then also disable that wildcard map on the /Content folder and below, allowing those static files to be processed natively by IIS (which performs much better).

How to set it up

First, deploy your application and use a wilcard map as explained before. Next, find out the “identifier” of your application by looking at IIS Manager:

image

Now, to remove the wildcard map on the /Content subdirectory, open a command prompt, go to c:\Inetpub\AdminScripts, and run:

adsutil.vbs SET /W3SVC/105364569/root/Content/ScriptMaps ""

… replacing 105364569 with the “identifier” number of your application. (Also, you could replace “Content” with the path to any other directory.)

That does it! Your /Content folder will now bypass the wildcard mapping, and its files will be served natively by IIS.

Alternative

If you don’t like to use adsutil.vbs, you can achieve the same by exploiting what appears to be a bug in IIS Manager. Turn your subdirectory into an application (from its Directory tab, click “Create”). Then edit its script mappings to remove aspnet_isapi.dll. Then go back and “Remove” the application you just created. The metabase’s new ScriptMaps value will be retained, even though the option has now disappeared from the GUI.

114 Responses to Overriding IIS6 wildcard maps on individual directories

  1. Nice post, you got some good points there – thank you.

  2. Yeeeeaaaaahhhhhh!!!! It works perfectly even on Windows XP :) ))) Thanks very much!!! :) ))

  3. One more thing. I run Fiddler and check content headers. For static files IIS send proper headers and IE (Firefox too) caches files – IIS responds 304. :) How it is possible? Maybe StaticFileHandler is smarter now?

  4. OMFG! After fighting with this for nearly 2 months on and off, your solution has finally solved this issue for me. THANK YOU VERY MUCH!!!

  5. You could also use Metabase Explorer (included in the IIS 6 Resource Kit) [http://support.microsoft.com/kb/840671#8] to edit the IIS metabase

  6. Canadian

    Thank you! This has greatly increased performance in one of our servers running IIS 6

  7. Natalie Zhuravleva

    I am trying to use option 1 but it is not working. The regular 404 page still gets invoked and asp.net does not show the asp.net “resource is missing” page. Any suggestions what I could have done wrong?

  8. Steve

    Natalie, one possibility is that you haven’t enabled ASP.NET (in IIS Manager’s Web Service Extensions)

  9. Tim

    Steve -

    To be frank… you’re the man when it comes to MVC! Days of frantic playing about, and then your blog comes to to the rescue (not for the first time I should say). I’m paying a visit to Amazon…

  10. Anton

    Thanks for finding this workaround!

    I’ve used it in a bit different way: for enabling wildcard ASP.NET processing on a specific folder and it worked. So root and all folders except “X” are processed as usually, but all requests to “X” get passed to aspnet_isapi.dll.

  11. Pingback: Getting ASP.Net MVC running on IIS6

  12. marc

    I found that just running the script against a directory would return an ‘object not found’ error from adsUtil script. However going into IIS and creating, then removing the application on that directory (IIS Folder properties) allowed the script to work (because the object entry was now in the metabase??)

  13. Jesse

    This is great… how do you verify that it is working as expected. For example, using Fiddler, what would you look for?

  14. Jim

    I implemented but I don’t see any difference in performance or response. As Jesse says, how do we know this is actually doing something different?

  15. Pingback: 随风飞扬 » Blog Archive » Deploying ASP.NET MVC to IIS 6

  16. Matt

    You can verify if this is working or not by doing the following:

    1. Setup Forms Authentication and or setup a page that requires authentication at the root level of that directory. E.g. yoursite/Admin/Default.aspx would require authentication.

    2. Within this folder you will invariably have an images folder or images somewhere. Let’s say the address is yoursite/Admin/Images/mycar.jpg

    3. Natively .NET will NOT require authentication for none “.net” resources like images. So if you ensure you are not authenticated then paste the absolute address of the image file into a browser i.e. http://www.yoursite.com/Admin/Images/mycar.jpg, your browser will display the image EVEN though this image is within a password protected area of the site. ASP.NET’s authentication system is not hit because the request is not for a .NET resource.

    4. If you have wildcard mapping enabled and it is acting upon requests for such a file, then instead of showing you the image, you will be required to login as the request will have gone through .NET and .NET would have invoked authenticated restrictions on the file.

    So yes, it can be tested.

  17. Jiho Han

    Here is another way to test that it works:

    Drop app_offline.htm that has links to css or images in content folder and see if it displays.

  18. Thanks for this good read. I actually appreciated it and I have bookmarked you to check out the fresh stuff you post.

  19. Nice site man! Keep up the good work haha.

  20. A semen fluid volume analysis examines some characteristics of a male’s semen fluid volume and the amount of sperm that is contained in the semen. It may be done while investigating a couple’s infertility or maybe after a vasectomy to check that the procedure was done successful. It is also used for testing some donors for semen donation. In the last few years it is really possible to increase semen fluid with absolutely safe ways like taking herbal pills from the many Internet stores. Sperm volume is the volume of semen concentration of sperms in your seminal liquid. A lot of factors are taken into consideration to measure the sperm count of a man such as the true length of time between ejaculations, semen sample analysis, how the sample is kept when being transported to the lab. Natural tablets is really awesome 100% herbal tested formula that without doubt will hugely increase the volume of semen ejaculation liquid by up to 500 percent. The amazingly leading herbal tablet contains a lot of ancient South African minerals, herbs and vitamins.

  21. Hello there. Appreciate your site. I check it regularly to see the latest info.

  22. Just want to say hello. Really awesome blog design. May I ask what template this is?

  23. Just want to say hi. Really cool blog design. May I ask what theme this is? I’ve been trying to find a good one for a while.

  24. I appreciate your work , thankyou for all the informative posts .

  25. olá galera, verdadeiramente enviar um SMS gratuito está cada vez mais difícil devido ao bloqueio das operadoras de celular. Há ainda os serviços que prometem entregar meu SMS mas nem sempre chegam destinatário final. Alguns como o Mundo oi e o Oi Torpedo funcionam mas e para as outras operadoras? E os que prometem que enviam e nada chega. Para onde está indo as meus torpedos? E para a Tim, Vivo? Alguma Idéia? Ou significa ter de pagar?. É só um desabafo, realmente está difícil achar serviços para mandar torpedos barato.

  26. The very core of your writing while sounding reasonable originally, did not sit perfectly with me after some time. Someplace throughout the sentences you managed to make me a believer but only for a short while. I nevertheless have got a problem with your leaps in assumptions and you would do well to fill in those breaks. When you can accomplish that, I would undoubtedly be impressed.

  27. I am curious to find out what blog platform you are utilizing? I’m experiencing some minor security issues with my latest blog and I’d like to find something more risk-free. Do you have any suggestions?

  28. Thank you for unshared
    But I must put more pictures.
    Affects people to pretty pictures.
    I really liked your site. Good luck.

  29. Good stuff! I’m happy to see the new structure on your blog urls.

  30. Hello, I can’t understand how to add your internet site in my rss reader. Can you Aid me, please

  31. This is really interesting, You are a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your site in my social networks!

  32. The quality of features crammed on the 3DS does come inside cost of a poor life of the battery. Nintendo were forthcoming concerning 3-5 hour battery, though which doesn’t allow it to less of a challenge to swallow. Usually there are some power saving ideas to push the playtime better the 5 hour mark: turning trip 3D, decreasing the brightness, making sure that wireless is deactivated. Though they can believe that hefty compromises for only a all-singing, all-dancing portable. The 3DS is probably a system you might play an awful lot while home, with the means to access an electric point, however, the key paltry battery could leave numerous commuters disappointed halfway owning an important boss battle. Bear in mind to bring along your charger and keep abreast of the red light. If the system is due to sleep mode, dealing only have a minuscule number of power, which is certainly handy.

  33. I’m really easy to get along with once you people be able to see it my technique.

  34. I love the precious information you provide within your articles. I am going to bookmark your blog and get my kids check up here regularly. I am quite sure they are going to study a lot of different stuff listed here than anyone else!

  35. I wonder how you got so competent. HaHa! This can be a fascinating blog, a lot of stuff that I will end up in. One thing I just want to express is that your design is so perfect! You certainly learn how to obtain a girls attention! Im glad that youre here. I feel as if Ive learned a new challenge since they can be here.

  36. I think this is among the most vital information for me. And i am glad reading your article. But should remark on few general things, The web site style is ideal, the articles is really great : D. Good job, cheers

  37. Just wanna remark that you have a very decent site, I love the design it actually stands out.

  38. Couldn?t be written any better. Looking over this post jogs my memory of my old room mate! He always kept discussing this. I’ll forward this article to him. Pretty sure he will have a good read. Many thanks for sharing!

  39. Appreciate it for helping out, superb information.

  40. My husband and i felt really happy that Albert managed to finish off his studies using the ideas he made in your site. It is now and again perplexing to simply always be freely giving tactics which often some people could have been making money from. So we acknowledge we have the blog owner to thank for this. The most important illustrations you’ve made, the simple web site navigation, the friendships you can make it easier to promote – it is everything great, and it’s really assisting our son and us consider that the issue is brilliant, which is especially serious. Thank you for all the pieces!

  41. Just found your site, but i found some problems browsing. The links in your sidebar aren’t working at the moment…

  42. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is fantastic blog. A fantastic read. I’ll certainly be back.

  43. Simply want to say your article is as astonishing. The clarity in your post is simply cool and i can assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please continue the rewarding work.

  44. Excellent post, cheers for submitting. I look forward to reading more from you. Also, I’m interested in where you got your blog template -Alex

  45. Howdy very cool blog!! Guy .. Excellent .. Wonderful .. I will bookmark your site and take the feeds also…I am satisfied to find a lot of helpful information here in the post, we’d like develop more strategies in this regard, thank you for sharing. . . . . .

  46. Cheers to your speech regarding reason nevertheless this post is likely to put your damper within the sales associated with tinfoil caps.

  47. For some reason only another half of the post is being scene, is it my web browser or the site?

  48. The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends such a man may be reckoned a complete man.

  49. you’re really a good webmaster. The site loading speed is amazing. It sort of feels that you’re doing any unique trick. Moreover, The contents are masterpiece. you have done a wonderful task in this matter!

  50. Definitely believe that which you said. Your favorite reason seemed to be on the net the easiest thing to be aware of. I say to you, I certainly get irked while people consider worries that they just don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people can take a signal. Will probably be back to get more. Thanks

  51. Aw, this was a really nice post. In concept I would like to put in writing like this moreover – taking time and precise effort to make a very good article… but what can I say… I procrastinate alot and not at all seem to get one thing done.

  52. Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is wonderful website. A great read. I’ll definitely be back…

  53. Hello, amazing topic I have just liked your facebook

  54. Please let me know if you’re looking for a author for your site. You have some really great articles and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine. Please blast me an email if interested. Thanks!

  55. An interesting dialogue is value comment. I feel that you must write extra on this topic, it might not be a taboo subject but generally persons are not sufficient to talk on such topics. To the next. Cheers

  56. biz

    Just wish to say your article is as surprising. The clarity in your post is just cool and i could assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.

  57. When installing Joomla on my computer in order to update a preexisting site, do I need my client to give me the Host Name, MySQL User Name, MySQL Password, MySQL Database NAme and MySQL Table Prefix? I already have their FTP information, and the Joomla admin control panel login information..

  58. Hey there every person, if you’re as intrigued in this short article as me, please make sure to email me, I would enjoy to chew the fat about that. My email is above. Bless you!

  59. Heyyy. Are you looking for a Assisted Living Facilities?

  60. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is great blog. A fantastic read. I will certainly be back.

  61. I like this website very much, Its a rattling nice billet to read and obtain info .

  62. 17. Thank you for the good writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how can we communicate?

  63. Splendid internet! I truly adoration just how it’s hassle-free with my eyes together with the word may be adequately written and published. I’m wondering could may very well be distinguished at any time when a brand new submit is make. I even have subscribed to your rss supply which will should do the trick! Use a agreeable day!

  64. We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable info to work on. You’ve done an impressive job and our entire community will be grateful to you.

  65. I like what you guys are up too. Such smart work and reporting! Keep up the superb works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my site .

  66. Could i simply claim what a therapy to seek relative no one actually is familiar with how theyre posting about on line. That you know how to deliver an issue to mild and produce this vital. More people must study these and fully grasp this kind of facet of the chronicle. I cant trust youre you can forget popular as you definitely have the offer.

  67. jaw

    Neat blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your theme. Appreciate it

  68. Bookmarked the site! Hope you will be posting more quality articles in the future.

  69. Remember the Lord your God, for it is He who gives you the power to get wealth. – Deuteronomy 8:18

  70. Painting CVontractor Birmingham

  71. I think a visualized presentation can be superior then simply a simple text, if things are defined in sketches one can easily be familiar with these.

  72. 3. Great post. I was checking constantly this blog and I’m impressed! Extremely useful info particularly the last part :) I care for such info a lot. I was seeking this particular information for a very long time. Thank you and best of luck.

  73. Basically to follow up on the up-date of this subject matter on your blog and would like to let you know just how much I treasured the time you took to write this valuable post. Within the post, you really spoke regarding how to truly handle this issue with all ease. It would be my pleasure to collect some more ideas from your site and come up to offer some others what I have benefited from you. Many thanks for your usual excellent effort.

  74. Thanks for sharing such a good opinion, paragraph is fastidious, thats why i have read it fully

  75. Thank you so much regarding giving everyone an update on this issue on your web-site. Please realise that if a fresh post appears or when any modifications occur to the current article, I would be considering reading more and focusing on how to make good usage of those techniques you share. Thanks for your time and consideration of other people by making this website available.

  76. I’ve been absent for some time, but now I remember why I used to love this weblog. Thank you, I will try and check back far more often. How frequently you update your internet internet site?

  77. I wasted money on cigarettes for forever. I understand it hurts my overall health so I wish to quit smoking though it’s difficult. None of the quit smoking gadgets worked for me. Then I heard about the smokeless cigarettes e liquid. It’s basically saved my life. No longer breathing toxic chemicals feels superb!

  78. Just want to say your article is as surprising. The clarity in your post is just nice and i can assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.

  79. I wanted to observe up and let you know the way , a fantastic deal I cherished discovering your internet blog today.

  80. F*ckin’ tremendous things here. I’m very glad to see your post. Thanks a lot and i’m looking forward to contact you. Will you please drop me a e-mail?

  81. Wonderful goods from you, man. I’ve understand your stuff previous to and you’re just too wonderful. I really like what you have acquired here, really like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it wise. I can’t wait to read far more from you. This is actually a great website.

  82. Excellent post. I was checking continuously this blog and I’m impressed! Very helpful info specifically the last part :) I care for such information much. I was looking for this particular info for a very long time. Thank you and best of luck.

  83. Pretty section of content. I just stumbled upon your web site and in accession capital to assert that I get actually enjoyed account your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently rapidly.

  84. I am so glad I found this blog. Thank you for the data. You make a lot of good points in your article. Rated five stars!

  85. hey there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise several technical issues using this website, since I experienced to reload the website many times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will sometimes affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Well I am adding this RSS to my email and can look out for much more of your respective interesting content. Make sure you update this again very soon..

  86. On this really topic, I try update my blogs almost like I’m speaking to somebody or talking to that reader directly as I consider it helps engage people a lot a lot more than writing content formally particularly when my own weblog is based around the goings ons, daily thoughts and research about this somewhat controversial concern. I discovered that I nonetheless want to use more of the strategies you’ve got mentioned in this posting.

  87. It’s the best time to make some plans for the future and it’s time to be happy. I’ve read this post and if I could I wish to suggest you few interesting things or tips. Maybe you can write next articles referring to this article. I desire to read more things about it!

  88. It was a very good idea! Just wanna say gracias for the information you have shared. Just keep writing this type of article. I will be your loyal follower. Thank you again.

  89. hey there and thank you for your info – I’ve certainly picked up anything new from right here. I did however expertise a few technical issues using this web site, since I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I am complaining, but slow loading instances times will sometimes affect your placement in google and could damage your high-quality score if ads and marketing with Adwords. Well I’m adding this RSS to my email and could look out for much more of your respective intriguing content. Ensure that you update this again soon..

  90. Very nice article. I certainly appreciate this website. Keep writing!

  91. Pretty section of content. I just stumbled upon your blog and in accession capital to assert that I get in fact enjoyed account your blog posts. Anyway I’ll be subscribing to your feeds and even I achievement you access consistently fast.

  92. Pretty section of content. I just stumbled upon your website and in accession capital to assert that I acquire actually enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently fast.

  93. hey there and thank you for your info – I have certainly picked up anything new from right here. I did however expertise a few technical issues using this web site, as I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I’m complaining, but sluggish loading instances times will sometimes affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Anyway I am adding this RSS to my e-mail and can look out for much more of your respective interesting content. Ensure that you update this again very soon..

  94. It is appropriate time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or suggestions. Maybe you could write next articles referring to this article. I desire to read more things about it!

  95. web marketing would be the next trend in advertising. there are millions of potential costumers on the internet ~.:

  96. Simply saying thanks won’t just be enough, for the wonderful readability in your documentation. I will instantly grab your rss feed to remain knowledgeable of any updates. Admirable work and far success in your online business endeavors!

  97. Wonderful beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog web site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear concept

  98. Hello, i think that i saw you visited my web site so i came to “return the favor”.I am attempting to find things to enhance my web site!I suppose its ok to use a few of your ideas!!

  99. Hello.This post was really interesting, especially because I was looking for thoughts on this issue last Sunday.

  100. I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are incredible! Thanks!

  101. Unquestionably believe that which you stated. Your favorite reason appeared to be on the web the simplest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they plainly don’t know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people could take a signal. Will likely be back to get more. Thanks

  102. Let’s company’s Holiday was established of its intention to become a travel agent’s service quality with reasonable prices.

  103. Tosha

    Wow! That’s an appealing slant.

  104. These all YouTube gaming video tutorials are really in good quality, I watched out all these along with my colleagues.

  105. That is some inspirational stuff. Never knew that opinions could be this varied. Thank you for all the enthusiasm to offer such handy information here. My kind regards, Isabelle.

  106. This post is really a nice one it assists new web users, who are wishing in favor of blogging.

  107. How do you verify that it is working as expected. For example, using Fiddler, what would you look for?

  108. Can you please email me the code for this script or please inform me in detail about this script?

  109. Hello, thanks for all the visitors, I will add many more video lessons in coming days, admin

  110. Overriding IIS6 wildcard maps on individual directories – Steve Sanderson’s blog – As seen on YouTubeâ„¢ Pretty nice post. I just stumbled upon your weblog and wanted to say that I’ve really enjoyed surfing around your blog posts. After all I’ll be subscribing to your rss feed and I hope you write again very soon!

  111. How come you do not have your site viewable in wap format? Can not view anything in my iPad.

  112. Overriding IIS6 wildcard maps on individual directories – Steve Sanderson’s blog – As seen on YouTubeâ„¢ I was suggested this website by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my difficulty. You’re incredible! Thanks! your article about Overriding IIS6 wildcard maps on individual directories – Steve Sanderson’s blog – As seen on YouTubeâ„¢Best Regards Agata

  113. Acquire so a lot from the contemplating,i favored your present post!

  114. I like what you are declaring, and really feel pleased I ran across your internet website. Remember to continue. Specialize in Plumbing