OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

For accessing JS or CSS or ico, the error: The page cannot be displayed because an internal server error has occurred. #8618

Closed johnmangam closed 2 years ago

johnmangam commented 2 years ago

The Orchard CMS page loads but not the CSS / JS / ico files.

When I try to access them I get the error: The page cannot be displayed because an internal server error has occurred.

MatteoPiovanelli-Laser commented 2 years ago

Hello,

We'll need more details than this, if possible.

Are you having this issue on the backend or the frontend? Is any theme active? What version of Orchard are you using?

Last I checked, both dev and 1.10.x worked out of the box, so any more details you could provide on this error would be helpful

johnmangam commented 2 years ago

Hi @MatteoPiovanelli-Laser

Instead of the default c:\ on the IIS, I have configured the website for a website folder on D drive. The website loads well.

Issues on the frontend. The application loads but js, css, ico, png do not get loaded.

When I try to access them, I get the error: The page cannot be displayed because an internal server error has occurred.

The current theme is: Terra

The version of Orchard CMS is Orchard v.1.9.2.0

Running on IIS version 10.0.20348.1

Part of web.config:

`

    <customErrors mode="Off"/>
    <pages>
        <namespaces>
            <add namespace="System.Collections.Generic"/>
            <add namespace="System.Linq"/>
            <add namespace="System.Web.Mvc"/>
            <add namespace="System.Web.Mvc.Ajax"/>
            <add namespace="System.Web.Mvc.Html"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="System.Web.WebPages"/>
            <add namespace="Orchard.Mvc.Html"/>
        </namespaces>
    </pages>
</system.web>    
<system.webServer>
    <!-- Prevent IIS from only allowing integrated mode configuration. -->
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="false">
        <remove name="OutputCache"/>
        <remove name="WarmupHttpModule"/>
        <add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.9.2, Culture=neutral"/>
    </modules>
    <handlers accessPolicy="Script">
        <!-- Clear all handlers, prevents executing code file extensions or returning any file contents. -->
        <clear/>
        <!-- Return 404 for all requests via a managed handler. The URL routing handler will substitute the MVC request handler when routes match. -->
        <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script"/>
        <!-- WebApi -->
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
    <!-- Prevent IIS 7.0 from returning a custom 404/500 error page of its own. -->
<httpErrors errorMode="Detailed" existingResponse="PassThrough"/> 
    <security>
        <requestFiltering>
            <!-- Accept file uploads up to 64 MB. -->
            <requestLimits maxAllowedContentLength="67108864"/>
        </requestFiltering>
    </security>
    <staticContent>
        <remove fileExtension=".woff" />
        <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
        <remove fileExtension=".js" />
        <mimeMap fileExtension=".js" mimeType="text/javascript" />
        <remove fileExtension=".svg" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
    </staticContent>
</system.webServer>`

Thank you.

MatteoPiovanelli-Laser commented 2 years ago

Two configurations that sometimes tripped things up on some servers I've seen:

Your specific setup (having the site in a folder under D:) is not an issue at all, and it's actually how I usually have things configured.

johnmangam commented 2 years ago

That's very helpful @MatteoPiovanelli-Laser

Thank you so much.