Run an ASP.NET website in a subfolder

后端 未结 5 1262
暗喜
暗喜 2020-12-15 17:51

Is there a way of running an ASP.NET website in a subfolder of the website?

As an example, say I wanted to run the screwturn wiki (http://www.screwturn.eu/) in a fol

相关标签:
5条回答
  • 2020-12-15 18:33

    I had to do this recently, and having made the wiki folder an application (as suggested in the previous answers) I also had to place a dummy 'App_Themes -> Default' folder at the top-level within the Wiki app because of the presence of the <pages styleSheetTheme="default" theme="default"> tag in the parent app's Web.config. Small hack, but that's the way I like to configure my styles in Asp.Net, and I didn't want to change that.

    0 讨论(0)
  • 2020-12-15 18:37

    As others pointed out. basically you need to put this in your child application Web.config, of course you also need to configure the domain (sub domain etc.), IIS setting as well.

    <configuration>    
      <location path="." inheritInChildApplications="false">
    
        //your code here
    
        <system.web>
          //your code here
        </system.web>
    
        //your code here
    
      </location>     
    </configuration>
    
    0 讨论(0)
  • 2020-12-15 18:38

    Short answer is YES you can. No need to specify the location of the folder in the Web.Config.

    0 讨论(0)
  • 2020-12-15 18:43

    You need to stop the configuration inheritance in the root web.config file so that the wiki web.config doesn't read anything from the root web.config.

    0 讨论(0)
  • 2020-12-15 18:49

    Piece of cake, you can either add a virtual directory to the root of the IIS website and point it at the path of your site or place it an a physical directory in the website root then turn it into an application by right-clicking on it in the IIS management console, going to properties and clicking "Create" next to application name.

    0 讨论(0)
提交回复
热议问题