【问题标题】:IIS 8 Configure page with subdirectory带有子目录的 IIS 8 配置页面
【发布时间】:2014-05-26 15:00:02
【问题描述】:

目前我已经在 IIS 中设置了我的页面。只能通过服务器的 IP 地址访问它(例如:“127.0.0.1”)。我想要做的是将页面移动到一个子目录,这样如果有人只使用 IP 地址,他将无法访问该页面(404 错误)。我希望可以使用以下内容访问该页面:“127.0.0.1/someName”。这应该让用户访问默认页面,就像现在一样。这可能吗? 谢谢!

【问题讨论】:

    标签: asp.net iis subdomain subdirectory


    【解决方案1】:

    您正在寻找Virtual Directories

    右键单击该站点,然后单击添加虚拟目录。给它一个名字(这将是子目录名称)。

    然后,只需确保您的虚拟目录配置了正确的默认页面。例如,如果 MyPage.aspx 应该是默认的,则将其作为默认文档放入。

    【讨论】:

    • 如果我在 Visual Studio 中使用 Web Deploy,我如何告诉它将页面发布到虚拟目录中?
    • @Cleo 什么版本的 Visual Studio?
    • 我相信在设置您的发布配置文件时,只需执行 www.mysite.com/MyApplication 其中 MyApplication 是您的虚拟目录的名称。
    • 谢谢,完成了这项工作!这是我所做的:- create a new page in iis - add a new virtual directory to the page - right-click the virtual directory and select "Convert to application" - in Visual Studio under "Publish" (Web Deploy), use the correct path to your virtual directory in "Websitename". Under "Server", just enter the IP of your target server.
    猜你喜欢
    • 2012-03-22
    • 2010-09-28
    • 1970-01-01
    • 1970-01-01
    • 2018-02-12
    • 2014-01-14
    • 2021-10-31
    • 2018-08-27
    • 1970-01-01
    相关资源
    最近更新 更多