[英]How to add custom directory in URL for app hosted locally on IIS?
I have the following situation for testing purposes my app is hosted on IIS on my machine and when I direct the physical path to the solution folder not the direct folder of the project when I try to access the .aspx file of the site I get the following error: 我出于测试目的而遇到以下情况,我的应用程序托管在计算机上的IIS上,当我尝试访问站点的.aspx文件时,将物理路径定向到解决方案文件夹而不是项目的直接文件夹时,以下错误:
The URL (it uses https protocol) is as it should be: URL(使用https协议)应为:
localhost:159/ SalesforceV5RapidSearch /RapidSearch.aspx?
本地主机:159 / SalesforceV5RapidSearch /RapidSearch.aspx?
The bolded folder must be there because on the staging server the URL is generated automatically and I have to make it work locally with this url. 粗体文件夹必须位于该文件夹中,因为在登台服务器上,URL是自动生成的,而我必须使它与此本地URL一起使用。 To the core of the problem when I direct the physical path to the project folder everything works and the Urls is
localhost:159/RapidSearch.aspx?
问题的核心是,当我将物理路径指向项目文件夹时,一切正常,并且
localhost:159/RapidSearch.aspx?
是localhost:159/RapidSearch.aspx?
the thing is I need that path to be the same as the above URL. 问题是我需要该路径与上述URL相同。
The given error is because the <authentication>
element can be set only in the global web.config
not in any of the subfolders and when I direct the path to the directory of the solution the web.config
used is in a subfolder. 给定的错误是因为
<authentication>
元素只能在全局web.config
设置,而不能在任何子文件夹中设置,并且当我将路径定向到解决方案的目录时,使用的web.config
位于子文件夹中。 Even if I put the project in two folders to make the URL the same it returns the same error because the web.config
is again in a subfolder and the IIS does not recognize it as global. 即使我将项目放在两个文件夹中以使URL相同,它也会返回相同的错误,因为
web.config
再次位于子文件夹中,并且IIS无法将其识别为全局文件夹。
确保您已安装IIS服务器的所有必需的身份验证功能,并且已在IIS中实际发布了该网站。
我找到了一种解决方案,该解决方案是将Web应用程序添加到IIS中的托管网站,该应用程序以这种方式通向目录,因此URL应为localhost:159 / SalesforceV5RapidSearch / RapidSearch.aspx?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.