我的客户在Aruba上托管了一个网站(Windows主机-具有PHP支持,这是我简单的web.config
文件的内容:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
</system.web>
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="File" >
<remove statusCode="404"/>
<remove statusCode="403"/>
<remove statusCode="500"/>
<error statusCode="404" path="404.html"/>
<error statusCode="403" path="403.html"/>
<error statusCode="500" path="500.html"/>
</httpErrors>
</system.webServer>
</configuration>
但是当我导航到默认URL https://<mywebsite>.it/
时,我从服务器收到HTTP 500错误,它没有将我重定向到默认index.php
页面。
我也曾在stackoverflow上发表过其他文章,但他们的解决方案无法解决我的问题。我想念什么?
我认为问题与web.config
相关,但它隐藏了另一个问题。正如@BradoZhang在评论中所建议的那样,我通过在<customErrors mode="Off"/>
的system.web
部分中添加了行web.config
来禁用自定义错误模式。比我看到的实际问题已经描述并解决了here on stackoverflow。