I have a SharePoint 2010 site and a custom web application. End goal is to be able to use cross-site JavaScript. They use different .net Frameworks so need to be separate IIS sites. How can I host both under http://website.com and http://website.com/site2 for example?
I have tried using one site inside the other as an application using a different application pool but have issues with the web.config files because of the duplicate references needed.
Try and create a new app pool for the /site2 site. Then set the App Pool attribute enableConfigurationOverride to false. This can only be done in appcmd or by editing the IIS Config file manually. Appcmd command is this:
appcmd.exe set config -section:system.applicationHost/applicationPools /[name='AppPoolName'].enableConfigurationOverride:"False" /commit:apphost
This will tell the sub site app pool to not import any settings from the parent web.config.
I was able to run a MVC site underneath a SharePoint site with this configuration.