如何在IIS10中修复HTTP错误404.8? (hiddenSegment)

问题描述 投票:0回答:1

我目前正在使用IIS和Visual Studio Code,试图与我的Web应用程序建立成功的服务器连接。这些是我遵循的步骤:

  1. 在IIS中创建了新的连接。 (connectionName:“ website1.com”,dir:“ C:\ inetpub \ wwwroot \ website1”,键入:“ http”,hostName:“ website1.com”,端口:80,ipAddress:“所有未分配”)
  2. 创建连接
  3. 我启用的项目的目录浏览:“时间”,“大小”,“扩展名”,“日期”。
  4. 在请求过滤下,我创建了一个新的hiddenSegment,名为“ _website1”。

以下文件“ web.config”在项目“ C:\ inetpub \ wwwroot \ website1”的目录中创建

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="true" />
        <security>
            <requestFiltering>
                <hiddenSegments>
                    <add segment="_website1" />
                </hiddenSegments>
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>

DEMO 1

enter image description here

问题:

  • 为什么段“ _website1”在webApp中不可见,为什么没有创建文件?
  • 我如何显示默认的IIS WebApp(具有蓝色背景和不同语言的WebApp?
  • [之后,如何与IIS和Visual Studio Code建立通讯? (在这种情况下,IIS Express扩展有用吗?)>
  • [如果您有任何信息,请告诉我。

我目前正在使用IIS和Visual Studio Code,试图与我的Web应用程序建立成功的服务器连接。这些是我遵循的步骤:在IIS中创建新连接...。

xml iis visual-studio-code iis-10 segment
1个回答
0
投票
  1. 隐藏的段并不意味着IIS将在您的请求URL中注入_website1。它只是指定将被阻止的URL segmenet集合。如果您的请求URL包含segmenet“ _website1”,则IIS返回404.8以阻止该请求。404.8的原因是web.config是请求过滤器中的默认隐藏segmenet值。
© www.soinside.com 2019 - 2024. All rights reserved.