Why my publish web on Win7 can't load css and img?

Topics: General, Troubleshooting
Oct 19, 2012 at 2:52 AM

I publish the orchard web site, browser the page I found none css and img(just show a red X). I think may be some config I need to config on the the publish server(Win7). If I input the img/ css address directly like "http://localhost/Themes/TheAdmin/Theme.png", will encount the HTTP 500 error.

Any one konw how to handle it please reply me.

Thanks

Coordinator
Oct 19, 2012 at 6:08 AM

You're probably missing a web.config in those directories.

Oct 19, 2012 at 6:42 AM
Edited Oct 19, 2012 at 6:43 AM

I don't think so. For I run it on the vs2010(use the WebDev) it can display correctly, but once publish to IIS it will lost all the style, why it happen?

PS: I have add the IIS_IUser permisstion to the static file(.css, .png), but still can't show the style.

Coordinator
Oct 19, 2012 at 4:39 PM

Any details on the 500 error? Anything in app_data\logs?

Oct 22, 2012 at 7:08 AM

There is no info in the logs after the 500 error. I think the error may happen at IIS, not reach to Orchard, so in orchard there is no info. no Style, still I feel so weird.

Coordinator
Oct 22, 2012 at 7:19 AM

And the 500 IIS screen itself gives no additional info?

Oct 23, 2012 at 12:12 AM

A missing web.config in those directories would give a 404 error as there would be no permissions to serve the static file - rather than a 500 error processing the web.config files in the static file directories - you will need to enable Trace Logging for a more detailed error report.

I have encountered this problem on IIS following a change to the web config files (Orchard 1.4.1) to include a cache setting for the HTTP headers - see this discussion for a possible fix to the problem - http://orchard.codeplex.com/discussions/397724.

As I do not have permissions to alter my server settings I had to revert to the web.config files from Orchard 1.3.9 - note these are the web.config files located in each directory where static files are served from, not the root web.config file. You may be able to change your server settings to allow this section of the web.config:

 

    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
    </staticContent>