0

My customer has a website hosted on Aruba (Windows Host - with PHP support) and this is the content of my simple web.config file:

<?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>

But when I navigate to the default URL https://<mywebsite>.it/ I get an HTTP 500 error from server and it doesn't redirect me to default index.php page.

I also seached in other posts on stackoverflow, but their solutions didn't solve my problems. What am I missing?

This is a screenshot of the error. Screenshot of the error from server Thank you in advance for your time!

gior91
  • 1,745
  • 1
  • 16
  • 19
  • What kind of Windows host? For PHP sites, the application pool should be No Managed Code to avoid such ASP.NET errors. – Lex Li Dec 08 '19 at 04:38
  • I'll check the kind of host and I'll let you know as soon as possible. Do you think that this problem is related to a server misconfiguration? Is `web.config` file correct according to you? Thank you! – gior91 Dec 08 '19 at 15:37
  • 1
    I suggest you could disable the custom error firstly. It will show the details error message. We should know what the details error you have faced now, then we could give you some useful information. Besides, you could also find the details error message in the event viewer. – Brando Zhang Dec 09 '19 at 02:13
  • @BrandoZhang thank you for your suggestion! I was searching in the wrong place! I disabled the custom error and I discovered that problem is related to this `https://stackoverflow.com/questions/21042535/gzipstream-could-not-be-found-reference-issue`. Problem solved! Thank you! – gior91 Dec 09 '19 at 18:32

1 Answers1

0

The problem was not related to web.config as I thought, but it hid a different issue. As suggested by @BradoZhang in the comments, I disabled the custom-errors mode by adding the line <customErrors mode="Off"/> in system.web section of web.config. Than I saw the real problem that it is already described and solved here on stackoverflow.

It is very strange because the website was working properly until few days ago. I think Aruba updated their servers configuration, but this is only a hypothesis.

gior91
  • 1,745
  • 1
  • 16
  • 19