I spent many hours pulling out my hair last weekend as I attempted to (and was finally successful) get a legacy ASP.NET application to run alongside DNN 4.3.5 in a folder (setup as a virtual directory) beneath the DNN application's root folder. A search for threads relating to this task turned up few suggestions. The task was made even more complicated by the need of the legacy application to do its own very simple Forms Authentication. The two main points to remember are that:
1. The application running in a sub-folder under the DNN root folder will inherit the web.config of its parent folder.
2. This is especially problematic in regards to the httpHandlers and httpModules that are added in the DNN web.config.
3. Even if the application running in the sub-folder (virtual directory) removes the DNN httpHandlers and httpModules in its own web.config, the related httpModules .dll files must be copied into a /bin folder in the sub-application's folder as they will be referenced before the application's web.config removes them.
4. If directory names have been added to the <compilation><codeSubDirectories> node in the DNN web.config, they must be repeated (and can be left empty) in the sub-application.
5. If the sub-application needs to do its own Forms Authentication, it's web.config must specify a different authentication cookie name than that used by the DNN application.
With this in mind, my folder structure looks like this:
domainname.org/public-html
/bin - DNN's bin folder
/portals - DNN's portals folder
. . . other DNN folders and files
default.aspx - DNN's default page
web.config - DNN's configuration file
/myapplication - sub-application's folder (set up as virtual directory)
/bin - sub-application's bin folder including all httpModules (all DotNetNuke.HttpModules.????.dll) copied from DNN's bin folder
/App_Code
/Reports - empty directory necessary to satisfy parent web.config <codeSubDirectories> specification
/login
login.aspx
default.aspx - sub-application's default page
... other sub-application files and folders
web.config - sub-application's configuration file (see below)
The next key to getting this to work was how the sub-application's web.config is set up:
<?
xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authentication mode="Forms">
<forms
loginUrl = "login/login.aspx"
name = ".SUBAPPAUTH">
<credentials passwordFormat="MD5">
<user name="xxxxxx" password="xxxxxx"></user>
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<
httpModules>
<remove name="UrlRewrite" />
<remove name="Exception" />
<remove name="UsersOnline" />
<remove name="DNNMembership" />
<remove name="Personalization" />
</httpModules>
<
httpHandlers>
<remove verb="GET" path="FtbWebResource.axd" />
<remove verb="*" path="*.captcha.aspx" />
<remove verb="*" path="LinkClick.aspx" />
</httpHandlers>
</system.web>
<
location path="login">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>
I hope that I didn't leave anything out and this will be of assistance!