multiple sites on IIS7 under the same URL and port but on different directories

 ̄綄美尐妖づ 提交于 2019-12-22 08:15:34

问题


I would like to host multiple applications on the same IIS. The problem is I need to use the same URL like www.example.com, but different directories. Also the port needs to be 80, or at least transparent to the end user, so I'd like to have something like his:

www.example.com/app1

www.example.com/app2

The problem is IIS does not let me create 2 sites with the same domain and the same port and I don't wanna use subdomains if possible.

Both apps should not be on the same site since they are separate applications with different mantainance schedules.

Is there a way to do this? Or do I have to use subdomains?


回答1:


If you have the app1 and app2 directories in the inetpub/wwwroot directory, and configure both of them as applications, it should have the effect you desire. Hope this helps...




回答2:


Have you considered using Virtual Directories? These directories could use different application pools and thus have different maintenence schedules.




回答3:


Your only other option other than the recommendations above is to use URL rewriting to have IIS translate the incoming URLs.

http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/




回答4:


The question is too old, but I run in the same issue.

Anirudh Ramanathan's answer is correct.

The solution is to add new Application in different ApplicationPools.

Right from Microsoft's documentation:

In the Connections pane, expand the Sites node.

Right-click the site for which you want to create an application, and click Add Application.

In the Alias text box, type a value for the application URL, such as marketing. This value is used to access the application in a URL.

Click Select if you want to select a different application pool than the one listed in the Application pool box. In the Select Application Pool dialog box, select an application pool from the Application pool list and then click OK.

In the Physical path text box, type the physical path of the application's folder, or click the browse button (...) to navigate the file system to find the folder.

Optionally, click Connect as to specify credentials that have permission to access the physical path. If you do not use specific credentials, select the Application user (pass-through authentication) option on the >Connect As dialog box.

Optionally, click Test Settings to verify the settings that you specified for the application.

Click OK.

Complete documentation here

N.B.: "click Test Settings to verify the settings that you specified for the application" may produce an error. According to other SO answers, it seems to be a bug. I ignore this alert and everything run well.



来源:https://stackoverflow.com/questions/6297632/multiple-sites-on-iis7-under-the-same-url-and-port-but-on-different-directories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!