Reputation: 46350
We have a web application on our server in a directory
c:\inetpub\wwwroot\myapp
Inside the myapp directory we have a sub directory called mysubapp
. mysubapp has its own bin directory, and requires DLLs in the myapp\bin
directory
So the directories are as follows:
c:\inetpub\wwwroot\myapp
c:\inetpub\wwwroot\myapp\bin
c:\inetpub\wwwroot\myapp\mysubapp
c:\inetpub\wwwroot\myapp\mysubapp\bin
We currently have IIS set up with host headers so that myapp.mycompany.com points to c:\inetpub\wwwroot\myapp
and http://mysubapp.mycompany.com
redirects to http://myapp.mycompany.com/mysubapp
.
We want mysubapp.mycompany.com to point to c:\inetpub\wwwroot\myapp\mysubapp
without having the URL say http://myapp.mycompany.com/mysubapp
.
I've tried setting up host headers to point but c:\inetpub\wwwroot\myapp\mysubapp
without using a redirect, but when we do this we get an error saying that certain DLL files can't be found, the DLL files not found are the ones in c:\inetpub\wwwroot\myapp\bin
. This error makes sense because an application can't locate DLLs outside of it's application directory.
Is there any way we can configure IIS to get this to work?
Upvotes: 1
Views: 1011
Reputation: 1472
A solution not involving url rewriting would be the following:
Upvotes: 0
Reputation: 104040
If I correctly understand your question, the only working setup that I could imagine is to take the approach you mention (host headers to point but c:\inetpub\wwwroot\myapp\mysubapp
without using a redirect) and include the main app's DLLs in your sub folder's bin directory.
Upvotes: 4
Reputation: 37215
If you want to serve /mysubapp under a different domain name, I don't see the point in keeping it under myapp.
Set up the applications as separate web apps, and copy the dlls from myapp to mysubapp. As it is Asp.Net, you may even do some assembly binding magic via the web.config file.
Upvotes: 0
Reputation: 23315
As DreamSonic said, use a different website for each application, with different IP addresses for each. To add more than a single IP to the server, use the advanced button on the Internet Protocol (tcp/Ip) dialog box in Network Properties. In IIS, set the website to respond to the specified IP instead of the default of [All Unassigned]. You don't need two (or more) NIC's.
Other than that, you'll need to do some URL rewriting, which can be a pain because all of the links in your app will need to "fixed" or else you'll eventually end up with the undesirable URL in the client's browser.
Upvotes: 0
Reputation: 350
You need to use url rewriting.
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
Upvotes: 2
Reputation: 6795
Although the answer doesn't take into account host headers the proposed work around in this link might be useful.
Upvotes: 1