[在web.config中设置默认页面时出现错误500

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

我的客户在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上发表过其他文章,但他们的解决方案无法解决我的问题。我想念什么?

这是错误的屏幕截图。Screenshot of the error from server预先感谢您的宝贵时间!

http iis web-config
1个回答
0
投票

我认为问题与web.config相关,但它隐藏了另一个问题。正如@BradoZhang在评论中所建议的那样,我通过在<customErrors mode="Off"/>system.web部分中添加了行web.config来禁用自定义错误模式。比我看到的实际问题已经描述并解决了here on stackoverflow

这很奇怪,因为该网站直到几天前仍能正常工作。我认为Aruba更新了其服务器配置,但这只是一个假设。
© www.soinside.com 2019 - 2024. All rights reserved.