Asp.net 出现:HTTP 错误 404.0 - Not Found

本文讨论了在客户端浏览器输入不存在的URL地址时,服务器物理位置意外暴露的问题,并详细解释了问题产生的原因——web.config文件中多了一个错误配置节点。通过移除此节点,可以防止服务器位置被不当泄露。

网站部署到服务器后,在客户端浏览器中输入一个不存在的url地址,结果却出现如下错误:(暴露了服务器网站部署的物理位置)

仔细查看网站的web.config发现,多了一个配置节点:

<system.webServer>
    
<httpErrors errorMode="Detailed" />
</system.webServer>

移除该节点后,输入不存在的url地址后,不会再存在以上的问题。

转载于:https://www.cnblogs.com/linyechengwei/archive/2011/08/07/2130068.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IIS 10.0 详细错误 - 404.0 - Not Found</title> <style type="text/css"> <!-- body { margin: 0; font-size: .7em; font-family: Verdana, Arial, Helvetica, sans-serif; } code { margin: 0; color: #006600; font-size: 1.1em; font-weight: bold; } .config_source code { font-size: .8em; color: #000000; } pre { margin: 0; font-size: 1.4em; word-wrap: break-word; } ul, ol { margin: 10px 0 10px 5px; } ul.first, ol.first { margin-top: 5px; } fieldset { padding: 0 15px 10px 15px; word-break: break-all; } .summary-container fieldset { padding-bottom: 5px; margin-top: 4px; } legend.no-expand-all { padding: 2px 15px 4px 10px; margin: 0 0 0 -12px; } legend { color: #333333; ; margin: 4px 0 8px -12px; _margin-top: 0px; font-weight: bold; font-size: 1em; } a:link, a:visited { color: #007EFF; font-weight: bold; } a:hover { text-decoration: none; } h1 { font-size: 2.4em; margin: 0; color: #FFF; } h2 { font-size: 1.7em; margin: 0; color: #CC0000; } h3 { font-size: 1.4em; margin: 10px 0 0 0; color: #CC0000; } h4 { font-size: 1.2em; margin: 10px 0 5px 0; } #header { width: 96%; margin: 0 0 0 0; padding: 6px 2% 6px 2%; font-family: "trebuchet MS", Verdana, sans-serif; color: #FFF; background-color: #5C87B2; } #content { margin: 0 0 0 2%; position: relative; } .summary-container, .content-container { background: #FFF; width: 96%; margin-top: 8px;
最新发布
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值