我有一个Web应用程序,该Web应用程序托管在Amazon EC2实例的iis7
中。目录结构类似于Website>Pages>welcome.aspx
.iis站点的物理路径已在网站级别设置。我添加了默认页面作为pages/welcome.aspx
。现在,当我们访问网站时,网站将重定向到默认页面,但URL仍像abc.com:XXXX
而不是abc.com:XXXX/pages/welcome.aspx
。现在,当有人单击以下链接时, href类似于abcd.aspx
,因为它在根目录中而不是pages目录中搜索内容,所以引发了页面未找到异常。
Go to your web.config and add:
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="pages/welcome.aspx" />
</files>
</defaultDocument>
</system.webServer>
From this post .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.