Last post Jan 21, 2015 01:08 PM by deinan1
Jan 08, 2015 11:02 AM|deinan1|LINK
I have an MVC website that I have installed in a sub directory of my main web root. I have it running fine except that the links are all based on being in the web root rather than the sub directory. I don't know ASP.NET. The app was created by a developer
who is no longer available. Following a couple of posts I found on this site, I managed to deal with the webconfig inheritance issue to get the site to run and I found another that talked about adding the sub directory to the default routes.MapRoute.
Is there some setting somewhere in IIS or can anyone suggest a possible solution?
Jan 09, 2015 05:56 AM|AidyF|LINK
You can't run one site inside another just by putting it in a sub-directory. Instead make a Virtual Directory in the parent site that links to the folder where you have your MVC site. Virtual Directories are how you do "site within a site". Google for
how to create a virtual directory if you don't know how, it's quite straight-forward.
Jan 09, 2015 12:49 PM|deinan1|LINK
Thanks for answering. Actually it is possible. I have tried it both ways and the site runs fine either way except that in both cases the links generated by the app code all point to the parent root and not the sub directory so they are all broken. I was
hoping to find a way or a setting to fix this.
Jan 10, 2015 08:40 AM|AidyF|LINK
Use a Virtual Directory.
Jan 21, 2015 01:08 PM|deinan1|LINK
Thanks for your help but the problem was not how to run a site within a site. The problem was how to fix the auto generated links within the web app once it is set up via virtual directory. The sub-app if you will runs like it is in the webroot when in fact
it is in a virtual sub directory. So all the links within the sub app point to the root rather that the sub root. I was hoping for a global way to fix this issue.