I currently have a typical "Force HTTP to HTTPS" URL rewrite code in place. This works perfectly for my entire website; including a couple well-written ASP.NET apps Im using. However, I have one ASP.NET app that's throwing a "Directory Not Found" exception if my "Force HTTP to HTTPS" rule is active (probably due to specifying full paths to files and directories instead of relative references, not sure).

I certainly dont have the experience modify the ASP.NET app code (since I didnt write the app). So, I was hoping someone could please see how to add a condition to ignore one folder (and respective ASP.NET app); while keeping everything else as-is.

I already tried adding the below line inside the conditions area above; but, it doesnt make any difference; and, still get the same error about the directory missing. If I remove the web.config file completely from the root of my website, I dont get that error anymore.

If someone have a better way to implement a "Force HTTP to HTTPS" rule; which is more ASP.NET application friendly, I would prefer to do that instead of writing a condition (maybe having an improved rule and condition might be best)?

I have tried asking for help in various Internet websites; unfortunately, nobody seems to know much about how to do this. Either that, or they just didnt want to help. It seems like there are many more skilled people on EE; which may be worth it.

Thanks for the quick reply. Unfortunately, that rule seems to do pretty much the same thing my current rule does that I posted above; including the same error message about, "Directory Not Found" in my asp.net app, "/photos" (http://mywebsiteUR.com/photos). I even tried adding the below condition in an attempt to ignore the directory; but STILL getting the error.

Thanks. Unfortunately, I am STILL seeing the same error for my /photos asp.net app. There is something in my web.config that's causing my /photos app to produce that error. If I remove the web.config file entirely, I dont get the error at all.

I included the exact error message (see attached screenshot of error). Maybe, its possible to just modify the app itself to be "force-https" rule friendly? I also attached the source code itself; which might be something relatively easy to fix. I suspect it's using a full physical path references instead of relative path.

Otherwise, we would have to figure out which part of my web.config the /photos app doesnt like.

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Unfortunately, same problem in both IE and Firefox. Below is the exact line-line code for my entire web.config. It still produced the same "directory not found error" when this file is in the wwwroot directory.

Notice I have one added condition in order to only apply the "force https" rule only incoming 192.168.1.2 requests. For the purpose of keeping things simple, I wont get into why I need it; just know that the force https rule wont work without that condition being there.

Your code worked perfectly! The only thing I had to add was</httpErrors> after your first line.

I dont even have a apphost.config file. Will I need that too?

Lastly, while I have your attention, below is my entire web.config. I would like it to also force anyone who has their web browser open to keep their current connection to the server alive (as long as their web browser has any webpage from my website displayed in their web browser).

This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes.
Assigning simple products to configurable: We assigned simple products…