我使用了一个名为Kentico的CMS开发了一个新网站。
在我的Web Server上发布了名为Web3之后,它由2个文件夹组成:一个实时站点的文件夹(命名live)和一个admin站点的一台服务器(命名为admin)。
我的文件夹结构看起来像:
暂时,我的IIS安装看起来像:
,
所以我为实时站点创建了一个指向Live文件夹和一个的应用程序在IIS默认网站中指向管理文件夹的管理站点的应用程序。
因此,访问网站的URL为 http://web3.domain.org/live a href =“ http://web3.domain.org/admin” rel =“ nofollow noreferrer”> http://web3.domain.org/admin 。
它工作正常,但我想访问 http://web3.domain.org/ 和现在的管理站点: http://web3.domain.org/admin 。
我发现的一种解决方案是在IIS中创建一个新的网站,指向Live文件夹,并在其中添加一个新的应用程序,指向Admin文件夹:
可以正常工作,实时网站可在 http://web3.domain.org/ 和admin网站
我还试图在WWWROOOT下的Web.config中使用默认网站使用默认网站,
<rules>
<rule name="Root_URL_Rewrite" stopProcessing="true">
<match url="^(.*)" />
<action type="Rewrite" url="/Live/{R:0}" />
</rule>
</rules>
但它不起作用。
欢迎您的帮助。
I have developed a new website using a CMS named Kentico.
After being published on my web server named web3, it consists of 2 folders: a folder for the live site (named live) and one server for the admin site (named admin).
My folder structure looks like:
For the time being, my IIS installation looks like:
So i have created an application for the live site pointing to the live folder and an application for the admin site pointing to the admin folder in the Default Web Site of IIS.
Therefore, the URLs to access the websites are http://web3.domain.org/Live and http://web3.domain.org/Admin.
It works fine but I want to access the live site at http://web3.domain.org/ and the admin site as it is now: http://web3.domain.org/Admin.
One solution I found was to create a new website in IIS pointing to the live folder and add a new application inside it pointing to the admin folder:
It works fine, the live site is accessible at http://web3.domain.org/ and the admin site at http://web3.domain.org/Admin.
However, I am not sure if it is the best option as the admin site is now dependent of the live site. If the live site is down, I won't have access to the admin site while they are technically independent (2 distinct folders).
I also tried to keep using the Default web site with some rewrite rules in a web.config under wwwrooot like :
<rules>
<rule name="Root_URL_Rewrite" stopProcessing="true">
<match url="^(.*)" />
<action type="Rewrite" url="/Live/{R:0}" />
</rule>
</rules>
but it didn't work.
Your help would be welcome.
发布评论
评论(1)
我建议创建两个独立的IIS网站。一个用于管理员应用程序(例如Admin.MOMETHET.COM)和第二个IIS网站的一个用于Live App(something.com)。或者,如果您想在同一域名上都有两个应用程序和子文件夹中的管理应用程序,则需要使用一个IIS网站 - 这将设置为实时应用程序,然后创建一个虚拟应用程序子文件夹,并将其指向管理应用程序。因此,您将基本上具有嵌套的管理应用程序 - 不建议这样做,因为在某些情况下,IIS可以检测两个Web.config文件,如嵌套,可能会引起问题。或者,IIS将将实时网站的配置文件作为主文件,而忽略嵌套的文件,等等。我将投票赞成两个独立的IIS网站。
I would recommend creating two separate IIS sites. One for the admin app (e.g. admin.something.com) and second IIS site for the live app (something.com). Or, if you want to have both apps on the same domain name and the admin app in a subfolder, then you need to use one IIS site - this will be set to the live app and then create a virtual application subfolder and point it to the admin app. So, you will have basically nested admin app - this is not recommended as in some cases IIS can detect two web.config files as nested and it could cause issues. Or, IIS will take the live site's config file as master and ignore the nested one, etc. I would vote for two separate IIS sites.