Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

.Text Tip: Non-Mapped Folders

One of the things that I've wanted for a long time with .Text is the ability to have folders that are not mapped to the .Text blogging engine. Well, I had a great idea while I was in the shower this morning (all great ideas come while bathing, at least in my experience), and it proved to work famously. Create your directory, create a new web.config file, and add the following information only:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>

 <httpHandlers>

     <clear />
            <add verb="*" path="trace.axd" type="System.Web.Handlers.TraceHandler" />
            <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory" />
            <add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory" />
            <add verb="*" path="*.asmx" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
            <add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
            <add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
            <add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler" />
            <add verb="GET,HEAD" path="*.dll.config" type="System.Web.StaticFileHandler" />
            <add verb="GET,HEAD" path="*.exe.config" type="System.Web.StaticFileHandler" />
            <add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.csproj" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.vb" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.vbproj" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.webinfo" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.asp" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.licx" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.resx" type="System.Web.HttpForbiddenHandler" />
            <add verb="*" path="*.resources" type="System.Web.HttpForbiddenHandler" />
            <add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler" />
            <add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler" />
 </httpHandlers> 

 <httpModules>
     <clear />
            <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
            <add name="Session" type="System.Web.SessionState.SessionStateModule" />
            <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
            <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
            <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
            <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
            <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
            <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 </httpModules>

 </system.web>
</configuration>

Basically, what this does is remap all of the extensions as described in the machine.config file for that directory only. The only problem with this method is, it will not process your IIS default documents, so if you were to say “http://blogs.yourblogsite.com/test”, you would receive a “Resource cannot be found” error, but if you said “http://blogs.yourblogsite.com/test/default.aspx” it would process normally.

There you have it, I hope someone finds this useful. I'll be implementing it over at LonghornBlogs.com momentarily.

Posted: Feb 03 2004, 09:24 AM by interscape | with no comments
Filed under:

Comments

No Comments